mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
__FILE__ should not update p->filename; fix #3485
This commit is contained in:
@@ -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__
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user