diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-15 23:29:55 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-15 23:34:32 +0900 |
| commit | 418ad65db40200058a023b57682f4a3853fd63bc (patch) | |
| tree | e8752f370c6022b80eae635bb8bca7274cd42582 /mrbgems/mruby-compiler/core/parse.y | |
| parent | 7e3e8d8ed5d9d12e7d3b0d616bf9b770f07e0d4f (diff) | |
| download | mruby-418ad65db40200058a023b57682f4a3853fd63bc.tar.gz mruby-418ad65db40200058a023b57682f4a3853fd63bc.zip | |
Fixed a bug in continuous read of target files; ref #4138
Line number information in a compiled file was wrong.
Diffstat (limited to 'mrbgems/mruby-compiler/core/parse.y')
| -rw-r--r-- | mrbgems/mruby-compiler/core/parse.y | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index 1c06be839..ac8724377 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -133,6 +133,10 @@ cons_gen(parser_state *p, node *car, node *cdr) c->cdr = cdr; c->lineno = p->lineno; c->filename_index = p->current_filename_index; + /* beginning of next partial file; need to point the previous file */ + if (p->lineno == 0 && p->current_filename_index > 0) { + c->filename_index-- ; + } return c; } #define cons(a,b) cons_gen(p,(a),(b)) |
