mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-03 11:08:32 +00:00
[AArch64] Check the size of the vector before accessing its elements.
This fixes an assert in AArch64AsmParser::MatchAndEmitInstruction. rdar://problem/23081753 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250207 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f066140cf7
commit
881068713c
@ -3967,7 +3967,7 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
|
||||
// suffix token operand. The short-form match failure is probably more
|
||||
// relevant: use it instead.
|
||||
if (MatchResult == Match_InvalidOperand && ErrorInfo == 1 &&
|
||||
((AArch64Operand &)*Operands[1]).isToken() &&
|
||||
Operands.size() > 1 && ((AArch64Operand &)*Operands[1]).isToken() &&
|
||||
((AArch64Operand &)*Operands[1]).isTokenSuffix()) {
|
||||
MatchResult = ShortFormNEONMatchResult;
|
||||
ErrorInfo = ShortFormNEONErrorInfo;
|
||||
|
@ -480,3 +480,12 @@ tlbi vale3
|
||||
; CHECK-ERRORS: error: invalid operand for instruction
|
||||
; CHECK-ERRORS: b.eq 0, 0
|
||||
; CHECK-ERRORS: ^
|
||||
|
||||
; Check that we give the proper "too few operands" diagnostic instead of
|
||||
; asserting.
|
||||
|
||||
ldr
|
||||
|
||||
; CHECK-ERRORS: error: too few operands for instruction
|
||||
; CHECK-ERRORS: ldr
|
||||
; CHECK-ERRORS: ^
|
||||
|
Loading…
x
Reference in New Issue
Block a user