diff options
author | Chris Lattner <sabre@nondot.org> | 2001-11-12 20:30:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-11-12 20:30:32 +0000 |
commit | 27afeb2be859be5cd5439a731983dd55977b1d08 (patch) | |
tree | 6c649a849566b1070f5287601ed1ca74050b4756 /lib/Bytecode/Reader/InstructionReader.cpp | |
parent | b7325433aa2e24b31c3356e20acbb22f21dfe3f7 (diff) |
Add an assertion check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1276 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/InstructionReader.cpp')
-rw-r--r-- | lib/Bytecode/Reader/InstructionReader.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Bytecode/Reader/InstructionReader.cpp b/lib/Bytecode/Reader/InstructionReader.cpp index fc4f73c784..6587ab2145 100644 --- a/lib/Bytecode/Reader/InstructionReader.cpp +++ b/lib/Bytecode/Reader/InstructionReader.cpp @@ -376,6 +376,8 @@ 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) Res = new LoadInst(getValue(Raw.Ty, Raw.Arg1), Idx); else if (Raw.Opcode == Instruction::GetElementPtr) |