Skip to content

Commit

Permalink
__FILE__ should not update p->filename; fix #3485
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Mar 7, 2017
1 parent 513f4fb commit 63dbed0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mrbgems/mruby-compiler/core/parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -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__
{
Expand Down

0 comments on commit 63dbed0

Please sign in to comment.