[PRISM] Fix popped on DefinedNode

This commit is contained in:
Jemma Issroff 2023-11-02 14:36:45 -03:00
Родитель 698654ca84
Коммит ca24136da6
2 изменённых файлов: 3 добавлений и 3 удалений

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

@ -1262,7 +1262,9 @@ pm_compile_defined_expr(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *con
lfinish[0] = NEW_LABEL(lineno);
lfinish[1] = 0;
pm_compile_defined_expr0(iseq, node, ret, src, popped, scope_node, dummy_line_node, lineno, in_condition, lfinish);
if (!popped) {
pm_compile_defined_expr0(iseq, node, ret, src, popped, scope_node, dummy_line_node, lineno, in_condition, lfinish);
}
if (lfinish[1]) {
ELEM_INSERT_NEXT(last, &new_insn_body(iseq, &dummy_line_node, BIN(putnil), 0)->link);

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

@ -89,7 +89,6 @@ module Prism
end
def test_DefinedNode
=begin
assert_prism_eval("defined? nil")
assert_prism_eval("defined? self")
assert_prism_eval("defined? true")
@ -140,7 +139,6 @@ module Prism
assert_prism_eval("x = 1; defined? x ||= 1")
assert_prism_eval("if defined? A; end")
=end
end
def test_GlobalVariableReadNode