[PRISM] Fixed popped for ConstantPathAndWriteNode

This commit is contained in:
Jemma Issroff 2023-11-02 15:18:40 -03:00
Родитель 00407894b5
Коммит 698654ca84
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -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));

Просмотреть файл

@ -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