diff options
| author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-02 15:18:40 -0300 |
|---|---|---|
| committer | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-02 17:46:43 -0300 |
| commit | 698654ca8456a7e08033cb4eab2d6e9cef7b1413 (patch) | |
| tree | 053076f4a7bda909fd416296e5bb337db3c1a899 | |
| parent | 00407894b559ccb97fb8beb7fc3c4cc55a5f11a7 (diff) | |
[PRISM] Fixed popped for ConstantPathAndWriteNode
| -rw-r--r-- | prism_compile.c | 4 | ||||
| -rw-r--r-- | test/ruby/test_compile_prism.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/prism_compile.c b/prism_compile.c index 3ac6268f41..59152d351e 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -1899,7 +1899,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, LABEL *lfin = NEW_LABEL(lineno); pm_constant_path_node_t *target = constant_path_and_write_node->target; - PM_COMPILE(target->parent); + PM_COMPILE_NOT_POPPED(target->parent); pm_constant_read_node_t *child = (pm_constant_read_node_t *)target->child; VALUE child_name = ID2SYM(pm_constant_id_lookup(scope_node, child->name)); @@ -1912,7 +1912,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, ADD_INSNL(ret, &dummy_line_node, branchunless, lfin); PM_POP_UNLESS_POPPED; - PM_COMPILE(constant_path_and_write_node->value); + PM_COMPILE_NOT_POPPED(constant_path_and_write_node->value); if (popped) { ADD_INSN1(ret, &dummy_line_node, topn, INT2FIX(1)); diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index fab66cad78..fbc637a390 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -211,8 +211,8 @@ module Prism end def test_ConstantPathAndWriteNode - # assert_prism_eval("Prism::CPAWN = 1; Prism::CPAWN &&= 2") - # assert_prism_eval("Prism::CPAWN &&= 1") + assert_prism_eval("Prism::CPAWN = 1; Prism::CPAWN &&= 2") + assert_prism_eval("Prism::CPAWN &&= 1") end def test_ConstantPathOrWriteNode |
