diff options
author | Jan Beulich <jbeulich@suse.com> | 2024-08-09 11:48:32 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2024-08-09 11:48:32 +0200 |
commit | d5de496c0eda2a7f47a183362e3108920d44d8d5 (patch) | |
tree | ff431c71608e04b28354259500e38f2475df3d10 /gas/app.c | |
parent | 8d627d3b319fb0110e2e8f018202b8f231d56411 (diff) | |
download | gdb-d5de496c0eda2a7f47a183362e3108920d44d8d5.zip gdb-d5de496c0eda2a7f47a183362e3108920d44d8d5.tar.gz gdb-d5de496c0eda2a7f47a183362e3108920d44d8d5.tar.bz2 |
gas: respect CR_EOL also for scrubbing
While apparently intended to be only externally controlled (e.g. via
specifying CFLAGS at make invocation), we should still keep scrubber and
lexer in sync in this regard. There's one place which imo was previously
wrong already, but would go further wrong and hence is being adjusted
right here: An .mri directive can be terminated by any kind of "line"
(really: statement) separators.
Diffstat (limited to 'gas/app.c')
-rw-r--r-- | gas/app.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -93,7 +93,11 @@ static char last_char; static char lex[256] = { [' '] = LEX_IS_WHITESPACE, ['\t'] = LEX_IS_WHITESPACE, +#ifdef CR_EOL + ['\r'] = LEX_IS_LINE_SEPARATOR, +#else ['\r'] = LEX_IS_WHITESPACE, +#endif ['\n'] = LEX_IS_NEWLINE, [':'] = LEX_IS_COLON, ['$'] = LEX_IS_SYMBOL_COMPONENT, @@ -857,7 +861,9 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen, ++mri_state; } else if (*mri_state != '\0' - || (!IS_WHITESPACE (ch) && !IS_NEWLINE (ch))) + || (!IS_WHITESPACE (ch) + && !IS_LINE_SEPARATOR (ch) + && !IS_NEWLINE (ch))) { /* We did not get the expected character, or we didn't get a valid terminating character after seeing the |