summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2024-11-04 14:57:52 -0500
committerKevin Newton <[email protected]>2024-11-05 17:08:35 -0500
commit4203c70dfa96649bae305350817d7cc3c9bc5888 (patch)
tree8492282fb4ebce9c1230f19376e9635bf995d0d5
parent4120f2babd7924a31c6d685be2429492af5c19b9 (diff)
Allow eval to see top scope
Fixes [Bug #20856] Co-Authored-By: Aaron Patterson <[email protected]>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11993
-rw-r--r--vm_eval.c2
1 files changed, 1 insertions, 1 deletions
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