mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user