diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-02 15:04:09 -0300 |
---|---|---|
committer | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-02 17:46:43 -0300 |
commit | 5acced49c2cd9309bcd92f38542e79eb0af87dd1 (patch) | |
tree | 371fae18decfda24cf0b5516fdd1f3eeefe5e30a /prism_compile.c | |
parent | 33f18b3d2fac1d79d33b895fca58290823765d07 (diff) | |
download | ruby-5acced49c2cd9309bcd92f38542e79eb0af87dd1.tar.gz |
[PRISM] Fix popped for SingletonClassNode
Diffstat (limited to 'prism_compile.c')
-rw-r--r-- | prism_compile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/prism_compile.c b/prism_compile.c index b8aeebd69f..865cbfc116 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -3322,7 +3322,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, const rb_iseq_t *singleton_class = NEW_ISEQ(next_scope_node, rb_fstring_lit("singleton class"), ISEQ_TYPE_CLASS, lineno); - PM_COMPILE(singleton_class_node->expression); + PM_COMPILE_NOT_POPPED(singleton_class_node->expression); PM_PUTNIL; ID singletonclass; CONST_ID(singletonclass, "singletonclass"); @@ -3330,6 +3330,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, ADD_INSN3(ret, &dummy_line_node, defineclass, ID2SYM(singletonclass), singleton_class, INT2FIX(VM_DEFINECLASS_TYPE_SINGLETON_CLASS)); + PM_POP_IF_POPPED; RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)singleton_class); return; |