From 4203c70dfa96649bae305350817d7cc3c9bc5888 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 4 Nov 2024 14:57:52 -0500 Subject: [PATCH] Allow eval to see top scope Fixes [Bug #20856] Co-Authored-By: Aaron Patterson --- vm_eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm_eval.c b/vm_eval.c index 469b89c03a..b326f2a09c 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -1682,7 +1682,7 @@ pm_eval_make_iseq(VALUE src, VALUE fname, int line, int scopes_count = 0; do { scopes_count++; - } while ((iseq = ISEQ_BODY(iseq)->parent_iseq) && (ISEQ_BODY(iseq)->type != ISEQ_TYPE_TOP)); + } while ((iseq = ISEQ_BODY(iseq)->parent_iseq)); pm_options_scopes_init(&result.options, scopes_count + 1); // Walk over the scope tree, adding known locals at the correct depths. The