`__FILE__` should not update `p->filename`; fix
MODIFY
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
@@ -2936,10 +2936,11 @@ var_ref : variable
}
| keyword__FILE__
{
- if (!p->filename) {
- p->filename = "(null)";
+ const char *fn = p->filename;
+ if (!fn) {
+ fn = "(null)";
}
- $$ = new_str(p, p->filename, strlen(p->filename));
+ $$ = new_str(p, fn, strlen(fn));
}
| keyword__LINE__
{

`__FILE__` should not update `p->filename`; fix #3485