Fix out of bound access in `parse.y`.
MODIFY
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
@@ -284,7 +284,7 @@ local_var_p(parser_state *p, mrb_sym sym)
int i;
if (!v) break;
- for (i=0; i < ir->nlocals; i++) {
+ for (i=0; i+1 < ir->nlocals; i++) {
if (v[i] == sym) return TRUE;
}
if (MRB_PROC_SCOPE_P(u)) break;

MODIFY
mrbgems/mruby-compiler/core/y.tab.c
mrbgems/mruby-compiler/core/y.tab.c
@@ -347,7 +347,7 @@ local_var_p(parser_state *p, mrb_sym sym)
int i;
if (!v) break;
- for (i=0; i < ir->nlocals; i++) {
+ for (i=0; i+1 < ir->nlocals; i++) {
if (v[i] == sym) return TRUE;
}
if (MRB_PROC_SCOPE_P(u)) break;

Fix out of bound access in `parse.y`.