summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2013-05-17 11:36:15 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2013-05-17 11:36:15 +0000
commit4ab1caedec17dacb1698830b7c082ccd2ef687cf (patch)
tree00923a5ad612100c29158ebd8a7c5ab3a961f2f7 /gnu/usr.bin
parentf083f1f074d50aa7a8ffa420ad964c330469fe2e (diff)
Don't reject '++' and '--' in expressions. Some versions of gcc emit these.
Fix found upstream. ok miod@, martynas@
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/binutils/gas/expr.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gnu/usr.bin/binutils/gas/expr.c b/gnu/usr.bin/binutils/gas/expr.c
index c792a2563f9..460a8372dd2 100644
--- a/gnu/usr.bin/binutils/gas/expr.c
+++ b/gnu/usr.bin/binutils/gas/expr.c
@@ -1021,8 +1021,9 @@ operand (expressionS *expressionP)
break;
case '+':
- /* Do not accept ++e as +(+e) */
- if (*input_line_pointer == '+')
+ /* Do not accept ++e as +(+e).
+ Disabled, since the preprocessor removes whitespace. */
+ if (0 && *input_line_pointer == '+')
goto target_op;
(void) operand (expressionP);
break;
@@ -1041,8 +1042,9 @@ operand (expressionS *expressionP)
case '!':
case '-':
{
- /* Do not accept --e as -(-e) */
- if (c == '-' && *input_line_pointer == '-')
+ /* Do not accept --e as -(-e)
+ Disabled, since the preprocessor removes whitespace. */
+ if (0 && c == '-' && *input_line_pointer == '-')
goto target_op;
operand (expressionP);
@@ -1580,8 +1582,9 @@ operator (int *num_chars)
case '+':
case '-':
- /* Do not allow a++b and a--b to be a + (+b) and a - (-b) */
- if (input_line_pointer[1] != c)
+ /* Do not allow a++b and a--b to be a + (+b) and a - (-b)
+ Disabled, since the preprocessor removes whitespace. */
+ if (1 || input_line_pointer[1] != c)
return op_encoding[c];
return O_illegal;