Fixed wrong condition in new_sym() that breaks symbol data.

parent a4ae22ae
...@@ -537,7 +537,8 @@ new_sym(codegen_scope *s, mrb_sym sym) ...@@ -537,7 +537,8 @@ new_sym(codegen_scope *s, mrb_sym sym)
if (s->irep->slen == MAXSYMLEN) { if (s->irep->slen == MAXSYMLEN) {
codegen_error(s, "too many symbols (max " MRB_STRINGIZE(MAXSYMLEN) ")"); codegen_error(s, "too many symbols (max " MRB_STRINGIZE(MAXSYMLEN) ")");
} }
if (s->scapa == MAXMSYMLEN) {
if (s->irep->slen > MAXMSYMLEN/2 && s->scapa == MAXMSYMLEN) {
s->scapa = MAXSYMLEN; s->scapa = MAXSYMLEN;
s->irep->syms = (mrb_sym *)codegen_realloc(s, s->irep->syms, sizeof(mrb_sym)*MAXSYMLEN); s->irep->syms = (mrb_sym *)codegen_realloc(s, s->irep->syms, sizeof(mrb_sym)*MAXSYMLEN);
for (i = s->irep->slen; i < MAXMSYMLEN; i++) { for (i = s->irep->slen; i < MAXMSYMLEN; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment