fixed wandering filename problem

parent cc98f191
......@@ -1157,7 +1157,7 @@ codegen(codegen_scope *s, node *tree, int val)
if (!tree) return;
if (s->irep && s->pc > 0 && s->filename_index != tree->filename_index) {
if (s->irep && s->filename_index != tree->filename_index) {
s->irep->filename = mrb_parser_get_filename(s->parser, s->filename_index);
mrb_debug_info_append_file(s->mrb, s->irep, s->debug_start_pos, s->pc);
s->debug_start_pos = s->pc;
......
......@@ -62,7 +62,12 @@ typedef unsigned int stack_type;
#define CMDARG_P() BITSTACK_SET_P(p->cmdarg_stack)
#define SET_LINENO(c,n) ((c)->lineno = (n))
#define NODE_LINENO(c,n) do {if (n) ((c)->lineno = (n)->lineno);} while (0)
#define NODE_LINENO(c,n) do {\
if (n) {\
(c)->filename_index = (n)->filename_index;\
(c)->lineno = (n)->lineno;\
}\
} while (0)
#define sym(x) ((mrb_sym)(intptr_t)(x))
#define nsym(x) ((node*)(intptr_t)(x))
......
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