Skip to content
Permalink
Browse files
Fixed wrong condition in new_sym() that breaks symbol data.
  • Loading branch information
matz committed Dec 12, 2016
1 parent a4ae22a commit 647ad29a7a1147e2c3ed93329cabbb974482697f
Showing 1 changed file with 2 additions and 1 deletion.
@@ -537,7 +537,8 @@ new_sym(codegen_scope *s, mrb_sym sym)
if (s->irep->slen == 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->irep->syms = (mrb_sym *)codegen_realloc(s, s->irep->syms, sizeof(mrb_sym)*MAXSYMLEN);
for (i = s->irep->slen; i < MAXMSYMLEN; i++) {

0 comments on commit 647ad29

Please sign in to comment.