summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-12 21:48:38 +0000
committerChris Lattner <sabre@nondot.org>2001-11-12 21:48:38 +0000
commit7c627e76321ce59dc3a418832c568bf0c2ff422c (patch)
treeda326891eed72f03161576c302f5c03166ea74f6 /llvm/lib/Bytecode/Reader
parent20e105f4b18c248ed11d8f3a44801536f0d310a8 (diff)
downloadbcm5719-llvm-7c627e76321ce59dc3a418832c568bf0c2ff422c.tar.gz
bcm5719-llvm-7c627e76321ce59dc3a418832c568bf0c2ff422c.zip
Fix bug in new assertion
llvm-svn: 1279
Diffstat (limited to 'llvm/lib/Bytecode/Reader')
-rw-r--r--llvm/lib/Bytecode/Reader/InstructionReader.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/Bytecode/Reader/InstructionReader.cpp b/llvm/lib/Bytecode/Reader/InstructionReader.cpp
index 6587ab21458..8dc9b8d565a 100644
--- a/llvm/lib/Bytecode/Reader/InstructionReader.cpp
+++ b/llvm/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: {
OpenPOWER on IntegriCloud