mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Fix an assert-on-inline-inline-asm bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28727 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
393830a33a
commit
fd561cded3
@ -656,24 +656,30 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
|
||||
// operand!
|
||||
if (CurVariant == -1 || CurVariant == AsmPrinterVariant) {
|
||||
unsigned OpNo = 1;
|
||||
|
||||
|
||||
bool Error = false;
|
||||
|
||||
// Scan to find the machine operand number for the operand.
|
||||
for (; Val; --Val) {
|
||||
if (OpNo >= MI->getNumOperands()) break;
|
||||
unsigned OpFlags = MI->getOperand(OpNo).getImmedValue();
|
||||
OpNo += (OpFlags >> 3) + 1;
|
||||
}
|
||||
|
||||
unsigned OpFlags = MI->getOperand(OpNo).getImmedValue();
|
||||
++OpNo; // Skip over the ID number.
|
||||
|
||||
bool Error;
|
||||
AsmPrinter *AP = const_cast<AsmPrinter*>(this);
|
||||
if ((OpFlags & 7) == 4 /*ADDR MODE*/) {
|
||||
Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant,
|
||||
Modifier[0] ? Modifier : 0);
|
||||
if (OpNo >= MI->getNumOperands()) {
|
||||
Error = true;
|
||||
} else {
|
||||
Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant,
|
||||
Modifier[0] ? Modifier : 0);
|
||||
unsigned OpFlags = MI->getOperand(OpNo).getImmedValue();
|
||||
++OpNo; // Skip over the ID number.
|
||||
|
||||
AsmPrinter *AP = const_cast<AsmPrinter*>(this);
|
||||
if ((OpFlags & 7) == 4 /*ADDR MODE*/) {
|
||||
Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant,
|
||||
Modifier[0] ? Modifier : 0);
|
||||
} else {
|
||||
Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant,
|
||||
Modifier[0] ? Modifier : 0);
|
||||
}
|
||||
}
|
||||
if (Error) {
|
||||
std::cerr << "Invalid operand found in inline asm: '"
|
||||
|
Loading…
Reference in New Issue
Block a user