diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-10-25 23:40:35 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-10-25 23:40:35 +0000 |
commit | 3bd9dcc08f1fc3431b6efdafcc005815141462b7 (patch) | |
tree | 0df5fa64d788fc143badef0b673244a5a33fbc90 /lib/Bitcode/Reader/Deserialize.cpp | |
parent | 8df77a9e0fbe32bd519ac2fd16ba28298a110a69 (diff) |
Updated backpatching during object deserialization to support "smart"
pointers that employ unused bits in a pointer to store extra data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader/Deserialize.cpp')
-rw-r--r-- | lib/Bitcode/Reader/Deserialize.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Bitcode/Reader/Deserialize.cpp b/lib/Bitcode/Reader/Deserialize.cpp index 3e16027839..66df46ea23 100644 --- a/lib/Bitcode/Reader/Deserialize.cpp +++ b/lib/Bitcode/Reader/Deserialize.cpp @@ -126,7 +126,9 @@ void Deserializer::BackpatchPointers() { assert (Entry.Ptr && "No pointer found for backpatch."); for (BPatchNode* N = Entry.Head; N != NULL; N = N->Next) - N->PtrRef = Entry.Ptr; + // Bitwise-OR in the pointer to support "smart" pointers that use + // unused bits to store extra data. + N->PtrRef |= reinterpret_cast<uintptr_t>(Entry.Ptr); Entry.Head = NULL; } |