aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-11-06 22:21:14 +0000
committerTed Kremenek <kremenek@apple.com>2007-11-06 22:21:14 +0000
commitb12a82dbf4653b25d6bf3f55eb617339e9086dde (patch)
tree00cc59d7eec511ca7fd232bb8c3a90fe79cc0fff /lib/Bitcode
parent373a733be031f52cebbbcdb15ab5997d9b5f9f17 (diff)
downloadexternal_llvm-b12a82dbf4653b25d6bf3f55eb617339e9086dde.zip
external_llvm-b12a82dbf4653b25d6bf3f55eb617339e9086dde.tar.gz
external_llvm-b12a82dbf4653b25d6bf3f55eb617339e9086dde.tar.bz2
Augmented ReadPtr and ReadOwnedPtr to control whether or not a pointer is allowed to be backpatched
or can be registered with the deserializer to backpatch other pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Reader/Deserialize.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Bitcode/Reader/Deserialize.cpp b/lib/Bitcode/Reader/Deserialize.cpp
index 5642f37..d4ed26b 100644
--- a/lib/Bitcode/Reader/Deserialize.cpp
+++ b/lib/Bitcode/Reader/Deserialize.cpp
@@ -152,7 +152,7 @@ void Deserializer::RegisterPtr(unsigned PtrId, const void* Ptr) {
SetPtr(E,Ptr);
}
-void Deserializer::ReadUIntPtr(uintptr_t& PtrRef) {
+void Deserializer::ReadUIntPtr(uintptr_t& PtrRef, bool AllowBackpatch) {
unsigned PtrId = ReadInt();
if (PtrId == 0) {
@@ -169,6 +169,9 @@ void Deserializer::ReadUIntPtr(uintptr_t& PtrRef) {
if (HasFinalPtr(E))
PtrRef = GetFinalPtr(E);
else {
+ assert (AllowBackpatch &&
+ "Client forbids backpatching for this pointer.");
+
// Register backpatch. Check the freelist for a BPNode.
BPNode* N;