diff options
author | Oleg Endo <olegendo@gcc.gnu.org> | 2018-01-22 14:31:10 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2018-01-22 14:31:10 +0000 |
commit | 49da480ff6208abc419fe66e030dfa052c11ee1b (patch) | |
tree | 757bba068e6add31ea3649048ea1de7735e8284e /gas/config/tc-rx.c | |
parent | f433138f1f9e6b8bcd93145a40ebae6c5d996792 (diff) | |
download | fsf-binutils-gdb-49da480ff6208abc419fe66e030dfa052c11ee1b.zip fsf-binutils-gdb-49da480ff6208abc419fe66e030dfa052c11ee1b.tar.gz fsf-binutils-gdb-49da480ff6208abc419fe66e030dfa052c11ee1b.tar.bz2 |
Fix the RX assembler so that it can handle escaped double quote characters, ie: \"
PR 22737
* config/tc-rx.c (rx_start_line): Handle escaped double-quote character.
* testsuite/gas/rx/pr22737.s: New test.
* testsuite/gas/rx/pr22737.d: Likewise.
* testsuite/gas/rx/rx.exp: Run the new test.
Diffstat (limited to 'gas/config/tc-rx.c')
-rw-r--r-- | gas/config/tc-rx.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gas/config/tc-rx.c b/gas/config/tc-rx.c index 8e49ddd..6c8befe 100644 --- a/gas/config/tc-rx.c +++ b/gas/config/tc-rx.c @@ -2681,6 +2681,7 @@ rx_start_line (void) int in_single_quote = 0; int done = 0; char * p = input_line_pointer; + char prev_char = 0; /* Scan the line looking for question marks. Skip past quote enclosed regions. */ do @@ -2693,7 +2694,9 @@ rx_start_line (void) break; case '"': - in_double_quote = ! in_double_quote; + /* Handle escaped double quote \" inside a string. */ + if (prev_char != '\\') + in_double_quote = ! in_double_quote; break; case '\'': @@ -2722,7 +2725,7 @@ rx_start_line (void) break; } - p ++; + prev_char = *p++; } while (! done); } |