The number of local variables should be less than 1024; fix
The `env` stores stack length in a 10 bit field.
See `MRB_ENV_STACK_LEN()` macro.
MODIFY
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
@@ -3020,6 +3020,9 @@ scope_finish(codegen_scope *s)
mrb_state *mrb = s->mrb;
mrb_irep *irep = s->irep;
+ if (s->nlocals >= 0x3ff) {
+ codegen_error(s, "too many local variables");
+ }
irep->flags = 0;
if (s->iseq) {
irep->iseq = (mrb_code *)codegen_realloc(s, s->iseq, sizeof(mrb_code)*s->pc);

The number of local variables should be less than 1024; fix #4370

The `env` stores stack length in a 10 bit field.
See `MRB_ENV_STACK_LEN()` macro.