This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RX] Fix for Bug 22737


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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]