aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode/Reader
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-10-25 18:42:52 +0000
committerTed Kremenek <kremenek@apple.com>2007-10-25 18:42:52 +0000
commit2423e03ca804e64998df1b65f58e62b867283c92 (patch)
treee1972402ad068ba4e4afdadc92bcf991e4901669 /lib/Bitcode/Reader
parent2c8ca5c415b876ef816286202621b1cf2c30fcad (diff)
Added special treatment of serializing NULL pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader')
-rw-r--r--lib/Bitcode/Reader/Deserialize.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Bitcode/Reader/Deserialize.cpp b/lib/Bitcode/Reader/Deserialize.cpp
index febb2d7caf..d1d6ef098f 100644
--- a/lib/Bitcode/Reader/Deserialize.cpp
+++ b/lib/Bitcode/Reader/Deserialize.cpp
@@ -103,6 +103,11 @@ void Deserializer::RegisterPtr(unsigned PtrId,void* Ptr) {
void Deserializer::ReadPtr(void*& PtrRef) {
unsigned PtrId = ReadInt();
+ if (PtrId == 0) {
+ PtrRef = NULL;
+ return;
+ }
+
BPatchEntry& E = BPatchMap[PtrId];
if (E.Ptr == NULL) {