summaryrefslogtreecommitdiff
path: root/gas/input-scrub.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-11-11 09:27:41 +0100
committerJan Beulich <jbeulich@suse.com>2022-11-11 09:27:41 +0100
commitb60f6a628897335a857c1e0100db0a4724159c45 (patch)
tree98837bf9afdc43c995c4e237b211672e5a002c9f /gas/input-scrub.c
parentca4726752f67661b75d9f7963a5eed93fbb7fa00 (diff)
downloadbinutils-gdb-b60f6a628897335a857c1e0100db0a4724159c45.tar.gz
gas: accept custom ".linefile <n> ."
While .linefile is generally intended for gas internal use only, its use in a source file would better not result in an internal error. Give use of it outside of any macro(-like) construct the meaning of restoring the original (physical) input file name.
Diffstat (limited to 'gas/input-scrub.c')
-rw-r--r--gas/input-scrub.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gas/input-scrub.c b/gas/input-scrub.c
index 44e4bdca521..650e3e38bbd 100644
--- a/gas/input-scrub.c
+++ b/gas/input-scrub.c
@@ -469,13 +469,15 @@ new_logical_line_flags (const char *fname, /* DON'T destroy it! We point to it!
/* FIXME: we could check that include nesting is correct. */
break;
case 1 << 3:
- if (line_number < 0 || fname != NULL || next_saved_file == NULL)
+ if (line_number < 0 || fname != NULL)
abort ();
/* PR gas/16908 workaround: Ignore updates when nested inside a macro
expansion. */
if (from_sb_expansion == expanding_nested)
return;
- if (next_saved_file->logical_input_file)
+ if (next_saved_file == NULL)
+ fname = physical_input_file;
+ else if (next_saved_file->logical_input_file)
fname = next_saved_file->logical_input_file;
else
fname = next_saved_file->physical_input_file;