mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-18 18:50:23 +08:00
BR 2034542: fix crash when touching __FILE__
Touching __FILE__ would cause a dereference of an uninitialized pointer. Fix.
This commit is contained in:
parent
f7d863b7d1
commit
932de6c252
@ -3493,7 +3493,7 @@ again:
|
||||
if (!m->expansion) {
|
||||
if (!strcmp("__FILE__", m->name)) {
|
||||
int32_t num = 0;
|
||||
char *file;
|
||||
char *file = NULL;
|
||||
src_get(&num, &file);
|
||||
tline->text = nasm_quote(file, strlen(file));
|
||||
tline->type = TOK_STRING;
|
||||
|
5
test/_file_.asm
Normal file
5
test/_file_.asm
Normal file
@ -0,0 +1,5 @@
|
||||
;Testname=bin; Arguments=-fbin -o_file_.bin; Files=.stdout .stderr _file_.bin
|
||||
db __FILE__, `\r\n`
|
||||
db __FILE__, `\r\n`
|
||||
dw __LINE__
|
||||
dw __LINE__
|
Loading…
x
Reference in New Issue
Block a user