summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authortompng <[email protected]>2024-08-06 23:29:45 +0900
committerNobuyoshi Nakada <[email protected]>2024-08-12 18:09:32 +0900
commit992596fb7af18a7f472589a607d0eb3fbb03b49a (patch)
tree609d85d4553880bba35dba01bda5e792a5e9b0b9 /compile.c
parent2a7da0b6e76929c684cd948630a897c1d5b16c26 (diff)
Fix next inside block argument stack underflow
[Bug #20344] Fix compile_next adding removable adjust label
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11316
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/compile.c b/compile.c
index e41f27daf9..95cede7afa 100644
--- a/compile.c
+++ b/compile.c
@@ -3070,8 +3070,7 @@ remove_unreachable_chunk(rb_iseq_t *iseq, LINK_ELEMENT *i)
/* do nothing */
}
else if (IS_ADJUST(i)) {
- LABEL *dest = ((ADJUST *)i)->label;
- if (dest && dest->unremovable) return 0;
+ return 0;
}
end = i;
} while ((i = i->next) != 0);
@@ -8205,7 +8204,6 @@ compile_next(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, in
add_ensure_iseq(ret, iseq, 0);
ADD_INSNL(ret, line_node, jump, ISEQ_COMPILE_DATA(iseq)->end_label);
ADD_ADJUST_RESTORE(ret, splabel);
- splabel->unremovable = FALSE;
if (!popped) {
ADD_INSN(ret, line_node, putnil);