summaryrefslogtreecommitdiff
path: root/prism_compile.c
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2023-11-06 22:14:50 +0000
committerMatt Valentine-House <matt@eightbitraptor.com>2023-11-07 14:03:57 +0000
commite7bdd9e498306a64c5785bdb642d192e1f513c84 (patch)
treee8fe94628fe8fca572856939f0f62e779f33ba26 /prism_compile.c
parentb7d5a63b9a0f762ef15572c14b40a784a5c27c35 (diff)
[PRISM] Move Local table setup into EnsureNode compilation
Diffstat (limited to 'prism_compile.c')
-rw-r--r--prism_compile.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/prism_compile.c b/prism_compile.c
index 32d5a07aa0..d64c60f588 100644
--- a/prism_compile.c
+++ b/prism_compile.c
@@ -1079,15 +1079,7 @@ pm_scope_node_init(const pm_node_t *node, pm_scope_node_t *scope, pm_scope_node_
}
case PM_ENSURE_NODE: {
pm_ensure_node_t *cast = (pm_ensure_node_t *)node;
-
- // HAXXX
- pm_constant_id_t err_info = 3863;
- pm_constant_id_list_t locals;
- pm_constant_id_list_init(&locals);
- pm_constant_id_list_append(&locals, err_info);
-
scope->body = (pm_node_t *)cast->statements;
- scope->locals = locals;
break;
}
case PM_FOR_NODE: {
@@ -1591,6 +1583,11 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
pm_scope_node_t next_scope_node;
pm_scope_node_init((pm_node_t *)begin_node->ensure_clause, &next_scope_node, scope_node, parser);
+ pm_constant_id_list_t locals;
+ pm_constant_id_list_init(&locals);
+ pm_constant_id_list_append(&locals, idERROR_INFO);
+ next_scope_node.locals = locals;
+
child_iseq = NEW_CHILD_ISEQ(next_scope_node,
rb_str_new2("ensure in"),
ISEQ_TYPE_ENSURE, lineno);