]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix ICE in assembler when passed a bogus input file.
authorNick Clifton <nickc@redhat.com>
Mon, 5 Dec 2016 16:54:59 +0000 (16:54 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 5 Dec 2016 16:54:59 +0000 (16:54 +0000)
PR gas/20904
* as.h (SKIP_ALL_WHITESPACE): New macro.
* expr.c (operand): Use it.

gas/ChangeLog
gas/expr.c
gas/read.h

index 53f773cc4f91ee2e25ef030cb3a4aadcd6f42928..a5622c7a32b70589366eb1ff369a925cdf9cab5e 100644 (file)
@@ -1,3 +1,9 @@
+2016-12-05  Nick Clifton  <nickc@redhat.com>
+
+       PR gas/20904
+       * as.h (SKIP_ALL_WHITESPACE): New macro.
+       * expr.c (operand): Use it.
+
 2016-12-05  Szabolcs Nagy  <szabolcs.nagy@arm.com>
 
        * config/tc-arm.c (do_vcmla, do_vcadd): Define.
index e8d553dd422b9a218bca611034c85b99cce0cc98..e1e49b217f03baf4a10ea2bfde2209f88a25a239 100644 (file)
@@ -1371,7 +1371,7 @@ operand (expressionS *expressionP, enum expr_mode mode)
   /* It is more 'efficient' to clean up the expressionS when they are
      created.  Doing it here saves lines of code.  */
   clean_up_expression (expressionP);
-  SKIP_WHITESPACE ();          /* -> 1st char after operand.  */
+  SKIP_ALL_WHITESPACE ();              /* -> 1st char after operand.  */
   know (*input_line_pointer != ' ');
 
   /* The PA port needs this information.  */
index e0cb6468b48e0ba95dc21ac431cc8c880d002fad..0a3ebf6c6af12e94ee83c846ef7bd4859bfdb2cb 100644 (file)
@@ -29,8 +29,11 @@ extern char *input_line_pointer;     /* -> char we are parsing now.  */
 #ifdef PERMIT_WHITESPACE
 #define SKIP_WHITESPACE()                      \
   ((*input_line_pointer == ' ') ? ++input_line_pointer : 0)
+#define SKIP_ALL_WHITESPACE()                  \
+  while (*input_line_pointer == ' ') ++input_line_pointer
 #else
-#define SKIP_WHITESPACE() know(*input_line_pointer != ' ' )
+#define SKIP_WHITESPACE() know (*input_line_pointer != ' ' )
+#define SKIP_ALL_WHITESPACE() SKIP_WHITESPACE()
 #endif
 
 #define SKIP_WHITESPACE_AFTER_NAME()           \