Watch out for variable_ops instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30135 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2006-09-06 20:32:45 +00:00
parent 3530bafe00
commit 48ff2fb129

View File

@ -493,7 +493,7 @@ void Emitter::emitInstruction(const MachineInstr &MI) {
emitRegModRMByte(MI.getOperand(CurOp++).getReg(),
(Desc.TSFlags & X86II::FormMask)-X86II::MRM0r);
if (CurOp != MI.getNumOperands())
if (CurOp != MI.getNumOperands() && MI.getOperand(CurOp).isImmediate())
emitConstant(MI.getOperand(CurOp++).getImm(), sizeOfImm(Desc));
break;