summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/compile.c b/compile.c
index b559703015..5bca0dca99 100644
--- a/compile.c
+++ b/compile.c
@@ -3761,14 +3761,20 @@ compile_array(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node_ro
case COMPILE_ARRAY_TYPE_HASH:
if (i > 0) {
if (first) {
- ADD_INSN1(anchor, line, newhash, INT2FIX(i));
+ if (!popped) {
+ ADD_INSN1(anchor, line, newhash, INT2FIX(i));
+ }
APPEND_LIST(ret, anchor);
}
else {
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN(ret, line, swap);
+ if (!popped) {
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN(ret, line, swap);
+ }
APPEND_LIST(ret, anchor);
- ADD_SEND(ret, line, id_core_hash_merge_ptr, INT2FIX(i + 1));
+ if (!popped) {
+ ADD_SEND(ret, line, id_core_hash_merge_ptr, INT2FIX(i + 1));
+ }
}
}
if (kw) {