diff options
author | Matt Valentine-House <[email protected]> | 2024-12-17 12:13:20 +0000 |
---|---|---|
committer | Matt Valentine-House <[email protected]> | 2024-12-17 15:13:53 +0000 |
commit | 86cf18e01e8be1db6194b7cb27357150998d9056 () | |
tree | b6a1a49dc2181f1a716c1d95a1082826ed8ebec8 /prism_compile.c | |
parent | c25dd4ee472e1516be64b9b2f0a9e222ef7532d6 (diff) |
[PRISM] Recurse use_deconstructed_cache in Alternation Nodes
This fixes the behavioural difference between Prism and parse.y when evaluating the following code ```ruby 1 in [1 | [1]] ``` Fixes [Bug #20956]
Notes: Merged: https://.com/ruby/ruby/pull/12370
-rw-r--r-- | prism_compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2991,7 +2991,7 @@ pm_compile_pattern(rb_iseq_t *iseq, pm_scope_node_t *scope_node, const pm_node_t // First, we're going to attempt to match against the left pattern. If // that pattern matches, then we'll skip matching the right pattern. PUSH_INSN(ret, location, dup); - CHECK(pm_compile_pattern(iseq, scope_node, cast->left, ret, matched_left_label, unmatched_left_label, in_single_pattern, true, true, base_index + 1)); // If we get here, then we matched on the left pattern. In this case we // should pop out the duplicate value that we preemptively added to @@ -3004,7 +3004,7 @@ pm_compile_pattern(rb_iseq_t *iseq, pm_scope_node_t *scope_node, const pm_node_t // If we get here, then we didn't match on the left pattern. In this // case we attempt to match against the right pattern. PUSH_LABEL(ret, unmatched_left_label); - CHECK(pm_compile_pattern(iseq, scope_node, cast->right, ret, matched_label, unmatched_label, in_single_pattern, true, true, base_index)); break; } case PM_PARENTHESES_NODE: |