diff options
author | Chris Lattner <sabre@nondot.org> | 2001-11-12 21:48:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-11-12 21:48:38 +0000 |
commit | 77a316ad2bd41d16417a4571e84125b978957fa3 (patch) | |
tree | 611117c726b573c0dd732a1458ef8e33243bdbe9 /lib/Bytecode/Reader/InstructionReader.cpp | |
parent | 9d47866497683a99ced46db88b3729616ee219a5 (diff) |
Fix bug in new assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/InstructionReader.cpp')
-rw-r--r-- | lib/Bytecode/Reader/InstructionReader.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Bytecode/Reader/InstructionReader.cpp b/lib/Bytecode/Reader/InstructionReader.cpp index 6587ab2145..8dc9b8d565 100644 --- a/lib/Bytecode/Reader/InstructionReader.cpp +++ b/lib/Bytecode/Reader/InstructionReader.cpp @@ -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: { |