diff options
| author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-02 14:46:40 -0300 |
|---|---|---|
| committer | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-02 17:46:43 -0300 |
| commit | 0359f9ca674a9cb30729bf545ea0a07ab5344ec3 (patch) | |
| tree | 92af30e262b8af702c4ffbcab7e89bf44a0105d4 | |
| parent | ddf12e8a3be135baf77a8adc833a37f93cf8f3d1 (diff) | |
[PRISM] Fix popped for ConstantPathOperatorWriteNode
| -rw-r--r-- | prism_compile.c | 4 | ||||
| -rw-r--r-- | test/ruby/test_compile_prism.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/prism_compile.c b/prism_compile.c index 2439a8d006..efd80d43c4 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -1979,7 +1979,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, pm_constant_path_operator_write_node_t *constant_path_operator_write_node = (pm_constant_path_operator_write_node_t*) node; pm_constant_path_node_t *target = constant_path_operator_write_node->target; - PM_COMPILE(target->parent); + PM_COMPILE_NOT_POPPED(target->parent); PM_DUP; ADD_INSN1(ret, &dummy_line_node, putobject, Qtrue); @@ -1988,7 +1988,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, VALUE child_name = ID2SYM(pm_constant_id_lookup(scope_node, child->name)); ADD_INSN1(ret, &dummy_line_node, getconstant, child_name); - PM_COMPILE(constant_path_operator_write_node->value); + PM_COMPILE_NOT_POPPED(constant_path_operator_write_node->value); ID method_id = pm_constant_id_lookup(scope_node, constant_path_operator_write_node->operator); ADD_CALL(ret, &dummy_line_node, method_id, INT2FIX(1)); PM_SWAP; diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index 51f36f48a3..03b0f9f29e 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -219,7 +219,7 @@ module Prism end def test_ConstantPathOperatorWriteNode - # assert_prism_eval("Prism::CPOWN = 0; Prism::CPOWN += 1") + assert_prism_eval("Prism::CPOWN = 0; Prism::CPOWN += 1") end def test_GlobalVariableAndWriteNode |
