diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-06-27 14:32:43 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-06-27 14:32:43 +0900 |
| commit | e462b42ff05254f8142662c24b426b5af3b98173 (patch) | |
| tree | 87dddd2ffd655dcac629aa08e0c454b24311e6d0 /mrbgems/mruby-compiler/core/parse.y | |
| parent | 912b2f8df36c2698fcf46a768d5cdb2541e524e1 (diff) | |
| parent | 52b29f41a3f8364712f14aad69186eb69b825b10 (diff) | |
| download | mruby-e462b42ff05254f8142662c24b426b5af3b98173.tar.gz mruby-e462b42ff05254f8142662c24b426b5af3b98173.zip | |
Merge pull request #5495 from dearblue/eval.2
Fixed finding variables defined in the upper proc failed
Diffstat (limited to 'mrbgems/mruby-compiler/core/parse.y')
| -rw-r--r-- | mrbgems/mruby-compiler/core/parse.y | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index 8e68fa21a..96615e3bb 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -286,9 +286,10 @@ local_var_p(parser_state *p, mrb_sym sym) const mrb_sym *v = ir->lv; int i; - if (!v) break; - for (i=0; i+1 < ir->nlocals; i++) { - if (v[i] == sym) return TRUE; + if (v) { + for (i=0; i+1 < ir->nlocals; i++) { + if (v[i] == sym) return TRUE; + } } if (MRB_PROC_SCOPE_P(u)) break; u = u->upper; |
