mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-29 16:12:44 +00:00
[ms-inline asm] Avoid a false positive assertion
Assertion failed: (Start.isValid() == End.isValid() && "Start and end should either both be valid or both be invalid!") when parsing inline asm. SMLoc assumes that the first char * in the source is invalid. However, when parsing an inline asm the mnemonic is at this location. I don't want to change SMLoc, so use a trivial workaround. llvm-svn: 162381
This commit is contained in:
parent
de7cbacc5f
commit
437076336a
@ -1677,8 +1677,10 @@ MatchInstruction(SMLoc IDLoc,
|
||||
if ((Match1 == Match_MnemonicFail) && (Match2 == Match_MnemonicFail) &&
|
||||
(Match3 == Match_MnemonicFail) && (Match4 == Match_MnemonicFail)) {
|
||||
if (!WasOriginallyInvalidOperand) {
|
||||
ArrayRef<SMRange> Ranges = matchingInlineAsm ? EmptyRanges :
|
||||
Op->getLocRange();
|
||||
return Error(IDLoc, "invalid instruction mnemonic '" + Base + "'",
|
||||
Op->getLocRange(), matchingInlineAsm);
|
||||
Ranges, matchingInlineAsm);
|
||||
}
|
||||
|
||||
// Recover location info for the operand if we know which was the problem.
|
||||
|
Loading…
x
Reference in New Issue
Block a user