From c14b60630d680addd5b4ef9c9b159a26a5446483 Mon Sep 17 00:00:00 2001 From: Luke Gruber Date: Fri, 13 Sep 2024 12:42:56 -0400 Subject: [PATCH] Fix coding issue in prism_compile.c Make sure to set back `ISEQ_COMPILE_DATA(iseq)->current_block` for forwarding super nodes with a block. Fixes [Bug #20740] --- prism_compile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prism_compile.c b/prism_compile.c index 03aff09259..044ef5083d 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -8057,6 +8057,9 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, PUSH_GETLOCAL(ret, location, mult_local.index, mult_local.level); PUSH_INSN2(ret, location, invokesuperforward, new_callinfo(iseq, 0, 0, flag, NULL, block != NULL), block); if (popped) PUSH_INSN(ret, location, pop); + if (cast->block) { + ISEQ_COMPILE_DATA(iseq)->current_block = previous_block; + } return; }