aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/ConstantReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bytecode/Reader/ConstantReader.cpp')
-rw-r--r--lib/Bytecode/Reader/ConstantReader.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Bytecode/Reader/ConstantReader.cpp b/lib/Bytecode/Reader/ConstantReader.cpp
index baa367d52b..ae206daa37 100644
--- a/lib/Bytecode/Reader/ConstantReader.cpp
+++ b/lib/Bytecode/Reader/ConstantReader.cpp
@@ -250,7 +250,7 @@ bool BytecodeParser::parseConstPoolValue(const uchar *&Buf,
}
case Type::StructTyID: {
- const StructType *ST = (const StructType*)Ty;
+ const StructType *ST = Ty->castStructType();
const StructType::ElementTypes &ET = ST->getElementTypes();
vector<ConstPoolVal *> Elements;
@@ -267,6 +267,17 @@ bool BytecodeParser::parseConstPoolValue(const uchar *&Buf,
break;
}
+ case Type::PointerTyID: {
+ const PointerType *PT = Ty->castPointerType();
+ unsigned SubClass;
+ if (read_vbr(Buf, EndBuf, SubClass)) return failure(true);
+ if (SubClass != 0) return failure(true);
+
+
+ V = ConstPoolPointer::getNullPointer(PT);
+ break;
+ }
+
default:
cerr << __FILE__ << ":" << __LINE__
<< ": Don't know how to deserialize constant value of type '"