Added special treatment of serializing NULL pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43357 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Bitcode/Reader/Deserialize.cpp b/lib/Bitcode/Reader/Deserialize.cpp
index febb2d7..d1d6ef0 100644
--- a/lib/Bitcode/Reader/Deserialize.cpp
+++ b/lib/Bitcode/Reader/Deserialize.cpp
@@ -103,6 +103,11 @@
 void Deserializer::ReadPtr(void*& PtrRef) {
   unsigned PtrId = ReadInt();
   
+  if (PtrId == 0) {
+    PtrRef = NULL;
+    return;
+  }  
+  
   BPatchEntry& E = BPatchMap[PtrId];
   
   if (E.Ptr == NULL) {