mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
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
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user