summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-01-19 11:26:28 -0500
committerPeter Zhu <[email protected]>2024-01-19 14:09:32 -0500
commit740f0b52e051d6fd022bf4b9eeab078c841b49a2 (patch)
treeac4ae305dcc08f825d57a730c39a2526a4f90e09
parentefe4b8ac0f5de49dcb20806f5a6c2d90273e8d52 (diff)
[PRISM] Fix typo with pm_scope_node_destroy
We need to run the pm_scope_node_destroy after compiling the iseq.
-rw-r--r--prism_compile.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/prism_compile.c b/prism_compile.c
index cc2a71ce10..186b6742a3 100644
--- a/prism_compile.c
+++ b/prism_compile.c
@@ -6571,9 +6571,8 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
// We create another ScopeNode from the statements within the PostExecutionNode
pm_scope_node_t next_scope_node;
pm_scope_node_init((pm_node_t *)post_execution_node->statements, &next_scope_node, scope_node, parser);
- pm_scope_node_destroy(&next_scope_node);
-
const rb_iseq_t *block = NEW_CHILD_ISEQ(&next_scope_node, make_name_for_block(body->parent_iseq), ISEQ_TYPE_BLOCK, lineno);
+ pm_scope_node_destroy(&next_scope_node);
ADD_CALL_WITH_BLOCK(ret, &dummy_line_node, id_core_set_postexe, INT2FIX(0), block);
break;