summaryrefslogtreecommitdiff
path: root/prism_compile.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-01-31 13:42:11 -0500
committerKevin Newton <kddnewton@gmail.com>2024-01-31 14:11:14 -0500
commitcb98b018c05832d183812b03fb133cd11edee04b (patch)
tree049515bff5c7ad30d450b8b7882c25240ae6ff06 /prism_compile.c
parent95c9711d6e04af149c5b2238297f51932d55c685 (diff)
[PRISM] Fix else with rescue
Fixes ruby/prism#2307.
Diffstat (limited to 'prism_compile.c')
-rw-r--r--prism_compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/prism_compile.c b/prism_compile.c
index f5648381bb..abfcab10ab 100644
--- a/prism_compile.c
+++ b/prism_compile.c
@@ -3583,12 +3583,13 @@ pm_compile_rescue(rb_iseq_t *iseq, pm_begin_node_t *begin_node, LINK_ANCHOR *con
}
ISEQ_COMPILE_DATA(iseq)->in_rescue = prev_in_rescue;
+ ADD_LABEL(ret, lend);
+
if (begin_node->else_clause) {
PM_POP_UNLESS_POPPED;
PM_COMPILE((pm_node_t *)begin_node->else_clause);
}
- ADD_LABEL(ret, lend);
PM_NOP;
ADD_LABEL(ret, lcont);