Correction to assert statemtent to allow 32-bit unsigned numbers with the top bit...
authorRichard Barton <richard.barton@arm.com>
Thu, 1 May 2014 11:37:44 +0000 (11:37 +0000)
committerRichard Barton <richard.barton@arm.com>
Thu, 1 May 2014 11:37:44 +0000 (11:37 +0000)
This fixes an ARM assembler crash - regression test added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207747 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp
test/MC/ARM/thumb2-diagnostics.s

index a8227fcc10b838e58280c05bc6a942cadfcac12d..987f14d5dcb4f1a5f134c1005fc8636fe97cfe09 100644 (file)
@@ -9487,8 +9487,8 @@ unsigned ARMAsmParser::validateTargetOperandClass(MCParsedAsmOperand *AsmOp,
       int64_t Value;
       if (!SOExpr->EvaluateAsAbsolute(Value))
         return Match_Success;
-      assert((Value >= INT32_MIN && Value <= INT32_MAX) &&
-             "expression value must be representiable in 32 bits");
+      assert((Value >= INT32_MIN && Value <= UINT32_MAX) &&
+             "expression value must be representable in 32 bits");
     }
     break;
   case MCK_GPRPair:
index bb96db05b92982b82f231bc0c47a5a5aef5b99d3..b2b14bc13d6a6f02498b53793740c6ac16e14d2f 100644 (file)
@@ -81,3 +81,10 @@ foo2:
 @ CHECK-ERRORS:                  ^
 @ CHECK-ERRORS: error: immediate expression for mov requires :lower16: or :upper16
 @ CHECK-ERRORS:                  ^
+
+        and sp, r1, #80008000
+        and pc, r1, #80008000
+@ CHECK-ERRORS: error: invalid operand for instruction
+@ CHECK-ERRORS: error: invalid operand for instruction
+
+