mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
In erroneous inline assembly we could mistakenly try to access the
metadata operand as an actual operand, leading to an assert. Error out in this case. rdar://11007633 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153234 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
544b9b426f
commit
aa206ffa6b
@ -326,7 +326,11 @@ void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const {
|
||||
OpNo += InlineAsm::getNumOperandRegisters(OpFlags) + 1;
|
||||
}
|
||||
|
||||
if (OpNo >= MI->getNumOperands()) {
|
||||
// We may have a location metadata attached to the end of the
|
||||
// instruction, and at no point should see metadata at any
|
||||
// other point while processing. It's an error if so.
|
||||
if (OpNo >= MI->getNumOperands() ||
|
||||
MI->getOperand(OpNo).isMetadata()) {
|
||||
Error = true;
|
||||
} else {
|
||||
unsigned OpFlags = MI->getOperand(OpNo).getImm();
|
||||
|
Loading…
Reference in New Issue
Block a user