Fix bug in new assertion

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1279 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-11-12 21:48:38 +00:00
parent 9d47866497
commit 77a316ad2b

View File

@ -376,14 +376,17 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
delete Raw.VarArgs;
break;
}
assert(LoadInst::getIndexedType(Raw.Ty, Idx) &&
"Bad indices for GEP or Load!");
if (Raw.Opcode == Instruction::Load)
if (Raw.Opcode == Instruction::Load) {
assert(MemAccessInst::getIndexedType(Raw.Ty, Idx) &&
"Bad indices for GEP or Load!");
Res = new LoadInst(getValue(Raw.Ty, Raw.Arg1), Idx);
else if (Raw.Opcode == Instruction::GetElementPtr)
} else if (Raw.Opcode == Instruction::GetElementPtr)
Res = new GetElementPtrInst(getValue(Raw.Ty, Raw.Arg1), Idx);
else
abort();
if (!MemAccessInst::getIndexedType(Raw.Ty, Idx))
cerr << Res;
return false;
}
case Instruction::Store: {