[PRISM] Fix popped for CallOperatorWriteNode

This commit is contained in:
Jemma Issroff 2023-11-02 15:08:03 -03:00
Родитель d8bdb15a8b
Коммит 7f18448a8e
2 изменённых файлов: 3 добавлений и 4 удалений

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

@ -1655,7 +1655,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
flag = VM_CALL_FCALL;
}
PM_COMPILE(call_operator_write_node->receiver);
PM_COMPILE_NOT_POPPED(call_operator_write_node->receiver);
ID write_name_id = pm_constant_id_lookup(scope_node, call_operator_write_node->write_name);
ID read_name_id = pm_constant_id_lookup(scope_node, call_operator_write_node->read_name);
@ -1664,7 +1664,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
ADD_SEND_WITH_FLAG(ret, &dummy_line_node, read_name_id, INT2FIX(0), INT2FIX(flag));
PM_COMPILE(call_operator_write_node->value);
PM_COMPILE_NOT_POPPED(call_operator_write_node->value);
ADD_SEND(ret, &dummy_line_node, operator_id, INT2FIX(1));
if (!popped) {

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

@ -773,8 +773,8 @@ module Prism
end
def test_CallOperatorWriteNode
=begin
assert_prism_eval(<<-CODE
class PrismTestSubclass; end
def PrismTestSubclass.test_call_operator_write_node
2
end
@ -784,7 +784,6 @@ module Prism
PrismTestSubclass.test_call_operator_write_node += 1
CODE
)
=end
end
def test_ForwardingSuperNode