diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2008-11-12 01:41:12 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2008-11-12 01:41:12 +0000 |
commit | 8f3fbc1d40b75adc94ed62bf827b8b60c8d9aa93 (patch) | |
tree | 90a5f767ef83d7a36c4d90822b714ed531f4f403 | |
parent | 41701dac576bd42b99e51df47264639ec9c9bb46 (diff) | |
download | binutils-redhat-8f3fbc1d40b75adc94ed62bf827b8b60c8d9aa93.tar.gz |
* read.c (read_a_source_file): Rearrange evaluation order when
looking for '=' to avoid conditional on undefined contents of
input_line_pointer[1].
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/read.c | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index c89a192683..6857babbf1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2008-11-12 Hans-Peter Nilsson <hp@axis.com> + + * read.c (read_a_source_file): Rearrange evaluation order when + looking for '=' to avoid conditional on undefined contents of + input_line_pointer[1]. + 2008-11-06 Adam Nemet <anemet@caviumnetworks.com> * config/tc-mips.c (COP_INSN): Change logic to always return false diff --git a/gas/read.c b/gas/read.c index 121c97ad1c..1cf5e9a02e 100644 --- a/gas/read.c +++ b/gas/read.c @@ -791,10 +791,10 @@ read_a_source_file (char *name) /* Input_line_pointer->after ':'. */ SKIP_WHITESPACE (); } - else if (input_line_pointer[1] == '=' - && (c == '=' - || ((c == ' ' || c == '\t') - && input_line_pointer[2] == '='))) + else if ((c == '=' && input_line_pointer[1] == '=') + || ((c == ' ' || c == '\t') + && input_line_pointer[1] == '=' + && input_line_pointer[2] == '=')) { equals (s, -1); demand_empty_rest_of_line (); |