diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-12-13 02:32:50 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-12-13 02:33:28 +0900 |
| commit | 647ad29a7a1147e2c3ed93329cabbb974482697f (patch) | |
| tree | 6af53876924b4cf6d31246c57117f444f06f408e | |
| parent | a4ae22ae0cfe5efe420cb6b8c68c6ebadb9cead8 (diff) | |
| download | mruby-647ad29a7a1147e2c3ed93329cabbb974482697f.tar.gz mruby-647ad29a7a1147e2c3ed93329cabbb974482697f.zip | |
Fixed wrong condition in new_sym() that breaks symbol data.
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index 33d3f96d4..90bafb3c2 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -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++) { |
