mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-18 13:16:24 -04:00
[ARM] Fix parsing of special register masks
This parsing code was incorrectly checking for invalid characters, so an invalid instruction like: msr spsr_w, r0 would be emitted as: msr spsr_cxsf, r0 Differential revision: https://reviews.llvm.org/D30462 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296607 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -4330,7 +4330,7 @@ ARMAsmParser::parseMSRMaskOperand(OperandVector &Operands) {
|
||||
|
||||
// If some specific flag is already set, it means that some letter is
|
||||
// present more than once, this is not acceptable.
|
||||
if (FlagsVal == ~0U || (FlagsVal & Flag))
|
||||
if (Flag == ~0U || (FlagsVal & Flag))
|
||||
return MatchOperand_NoMatch;
|
||||
FlagsVal |= Flag;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
@ RUN: not llvm-mc -triple armv7a--none-eabi < %s |& FileCheck %s
|
||||
@ RUN: not llvm-mc -triple thumbv7a--none-eabi < %s |& FileCheck %s
|
||||
|
||||
msr apsr_c, r0
|
||||
@ CHECK: invalid operand for instruction
|
||||
msr cpsr_w
|
||||
@ CHECK: invalid operand for instruction
|
||||
msr cpsr_cc
|
||||
@ CHECK: invalid operand for instruction
|
||||
msr xpsr_c
|
||||
@ CHECK: invalid operand for instruction
|
||||
Reference in New Issue
Block a user