wrong condiiton in too many symbols check; #close #731

parent 315ecb60
...@@ -429,12 +429,12 @@ new_msym(codegen_scope *s, mrb_sym sym) ...@@ -429,12 +429,12 @@ new_msym(codegen_scope *s, mrb_sym sym)
int i, len; int i, len;
len = s->irep->slen; len = s->irep->slen;
if (len > 255) len = 255; if (len > 256) len = 256;
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
if (s->irep->syms[i] == sym) return i; if (s->irep->syms[i] == sym) return i;
if (s->irep->syms[i] == 0) break; if (s->irep->syms[i] == 0) break;
} }
if (i > 255) { if (i == 256) {
codegen_error(s, "too many symbols (max 256)"); codegen_error(s, "too many symbols (max 256)");
} }
s->irep->syms[i] = sym; s->irep->syms[i] = sym;
......
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