diff options
author | Chris Lattner <sabre@nondot.org> | 2004-01-09 05:42:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-01-09 05:42:34 +0000 |
commit | bc39a1a8c440074e3c4f8964fceb3cc12fc8e3d1 (patch) | |
tree | 3199865d36b686881ab9904e2a3f3dc10ab3ce11 | |
parent | e7d471ad3a692191975400e592cf17094dcdb101 (diff) | |
download | bcm5719-llvm-bc39a1a8c440074e3c4f8964fceb3cc12fc8e3d1.tar.gz bcm5719-llvm-bc39a1a8c440074e3c4f8964fceb3cc12fc8e3d1.zip |
Inching our way towards fixing PR82
llvm-svn: 10721
-rw-r--r-- | llvm/lib/Bytecode/Reader/InstructionReader.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Bytecode/Reader/InstructionReader.cpp b/llvm/lib/Bytecode/Reader/InstructionReader.cpp index 3ca00f35cc6..4beb2b0c11d 100644 --- a/llvm/lib/Bytecode/Reader/InstructionReader.cpp +++ b/llvm/lib/Bytecode/Reader/InstructionReader.cpp @@ -354,7 +354,10 @@ void BytecodeParser::ParseInstruction(const unsigned char *&Buf, for (unsigned i = 1, e = Args.size(); i != e; ++i) { const CompositeType *TopTy = dyn_cast_or_null<CompositeType>(NextTy); if (!TopTy) throw std::string("Invalid getelementptr instruction!"); - Idx.push_back(getValue(TopTy->getIndexType()->getPrimitiveID(), Args[i])); + // FIXME: when PR82 is resolved. + unsigned IdxTy = isa<StructType>(TopTy) ? Type::UByteTyID :Type::LongTyID; + + Idx.push_back(getValue(IdxTy, Args[i])); NextTy = GetElementPtrInst::getIndexedType(InstTy, Idx, true); } |