summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/compile.c b/compile.c
index 2fadf643ad..4fa3e473e2 100644
--- a/compile.c
+++ b/compile.c
@@ -1281,20 +1281,18 @@ update_catch_except_flags(struct rb_iseq_constant_body *body)
/* This assumes that a block has parent_iseq which may catch an exception from the block, and that
BREAK/NEXT/REDO catch table entries are used only when `throw` insn is used in the block. */
- if (body->parent_iseq != NULL) {
- pos = 0;
- while (pos < body->iseq_size) {
+ pos = 0;
+ while (pos < body->iseq_size) {
#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
- insn = rb_vm_insn_addr2insn((void *)body->iseq_encoded[pos]);
+ insn = rb_vm_insn_addr2insn((void *)body->iseq_encoded[pos]);
#else
- insn = (int)body->iseq_encoded[pos];
+ insn = (int)body->iseq_encoded[pos];
#endif
- if (insn == BIN(throw)) {
- struct rb_iseq_constant_body *parent_body = body->parent_iseq->body;
- set_catch_except_p(parent_body);
- }
- pos += insn_len(insn);
+ if (insn == BIN(throw)) {
+ set_catch_except_p(body);
+ break;
}
+ pos += insn_len(insn);
}
if (ct == NULL)