This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[RX] Fix for Bug 22737
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: binutils <binutils at sourceware dot org>
- Cc: Nick Clifton <nickc at redhat dot com>
- Date: Sat, 20 Jan 2018 20:41:05 +0900
- Subject: [RX] Fix for Bug 22737
- Authentication-results: sourceware.org; auth=none
Hi,
This is the same patch as I have posted in the PR.
OK to apply?
Cheers,
Oleg
diff --git a/gas/config/tc-rx.c b/gas/config/tc-rx.c
index 8e49ddd..df761b4 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,6 +2725,7 @@ rx_start_line (void)
break;
}
+ prev_char = *p;
p ++;
}
while (! done);