diff options
| author | Carlo Prelz <[email protected]> | 2017-10-12 09:54:02 +0200 |
|---|---|---|
| committer | Carlo Prelz <[email protected]> | 2017-10-12 09:54:02 +0200 |
| commit | af3d5d6c8aab08d5366c1da57dba375a8b2bfa5c (patch) | |
| tree | d1da10f1ed92e8b0d1ff4379288cef273edfffa7 /mrbgems/mruby-compiler | |
| parent | 80e03f3ffb40aa1cf6d40c1305fcd913bf82ab1d (diff) | |
| download | mruby-af3d5d6c8aab08d5366c1da57dba375a8b2bfa5c.tar.gz mruby-af3d5d6c8aab08d5366c1da57dba375a8b2bfa5c.zip | |
Correct a small error in parse.y, which causes the reading of unassigned memory (triggers an error when address sanitizer is active)
Diffstat (limited to 'mrbgems/mruby-compiler')
| -rw-r--r-- | mrbgems/mruby-compiler/core/parse.y | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index 82e4c7bdd..243d4ce4a 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -5723,7 +5723,7 @@ mrb_parser_set_filename(struct mrb_parser_state *p, const char *f) new_table = (mrb_sym*)parser_palloc(p, sizeof(mrb_sym) * p->filename_table_length); if (p->filename_table) { - memmove(new_table, p->filename_table, sizeof(mrb_sym) * p->filename_table_length); + memmove(new_table, p->filename_table, sizeof(mrb_sym) * p->current_filename_index); } p->filename_table = new_table; p->filename_table[p->filename_table_length - 1] = sym; |
