This is the mail archive of the binutils-cvs@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]

[binutils-gdb] Fix ICE in assembler when passed a bogus input file.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=14c1428b29fff12d8119ce6f4703be0de08197af

commit 14c1428b29fff12d8119ce6f4703be0de08197af
Author: Nick Clifton <nickc@redhat.com>
Date:   Mon Dec 5 16:54:59 2016 +0000

    Fix ICE in assembler when passed a bogus input file.
    
    	PR gas/20904
    	* as.h (SKIP_ALL_WHITESPACE): New macro.
    	* expr.c (operand): Use it.

Diff:
---
 gas/ChangeLog | 6 ++++++
 gas/expr.c    | 2 +-
 gas/read.h    | 5 ++++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 53f773c..a5622c7 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -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.
diff --git a/gas/expr.c b/gas/expr.c
index e8d553d..e1e49b2 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -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.  */
diff --git a/gas/read.h b/gas/read.h
index e0cb646..0a3ebf6 100644
--- a/gas/read.h
+++ b/gas/read.h
@@ -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()		\


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