diff options
| author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-09-20 11:05:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-20 11:05:45 -0400 |
| commit | 4c2fc88b2114045f496a0cd2743b7984d113e274 (patch) | |
| tree | 7f108eeefb165e261e041b794dc52467ce86dc37 | |
| parent | 53a373078d75544f05c3fb1eb6c6ee2d95282a08 (diff) | |
[YARP] Pop AliasNode when appropriate (#8466)
| -rw-r--r-- | yarp/yarp_compiler.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/yarp/yarp_compiler.c b/yarp/yarp_compiler.c index 51c769d30d..b6f453c906 100644 --- a/yarp/yarp_compiler.c +++ b/yarp/yarp_compiler.c @@ -541,10 +541,15 @@ yp_compile_node(rb_iseq_t *iseq, const yp_node_t *node, LINK_ANCHOR *const ret, ADD_INSN1(ret, &dummy_line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE)); ADD_INSN1(ret, &dummy_line_node, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE)); - YP_COMPILE(alias_node->new_name); - YP_COMPILE(alias_node->old_name); + YP_COMPILE_NOT_POPPED(alias_node->new_name); + YP_COMPILE_NOT_POPPED(alias_node->old_name); ADD_SEND(ret, &dummy_line_node, id_core_set_method_alias, INT2FIX(3)); + + if (popped) { + ADD_INSN(ret, &dummy_line_node, pop); + } + return; } case YP_AND_NODE: { |
