mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-20 11:08:27 +00:00
Fixed bug with inconsistent serialization/deserialization in matching
calls to BatchEmitOwnedPtrs and BatchReadOwnedPtrs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
553d22c29e
commit
dd479dd3fe
@ -228,6 +228,37 @@ public:
|
||||
|
||||
Ptrs[i] = p;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename T3>
|
||||
void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs,
|
||||
T2*& P2, T3*& P3,
|
||||
bool A1=true, bool A2=true, bool A3=true) {
|
||||
|
||||
BatchIDVec.clear();
|
||||
|
||||
for (unsigned i = 0; i < NumT1Ptrs; ++i)
|
||||
BatchIDVec.push_back(ReadPtrID());
|
||||
|
||||
SerializedPtrID ID2 = ReadPtrID();
|
||||
SerializedPtrID ID3 = ReadPtrID();
|
||||
|
||||
for (unsigned i = 0; i < NumT1Ptrs; ++i) {
|
||||
SerializedPtrID& PtrID = BatchIDVec[i];
|
||||
|
||||
T1* p = PtrID ? SerializeTrait<T1>::Materialize(*this) : NULL;
|
||||
|
||||
if (PtrID && A1)
|
||||
RegisterPtr(PtrID,p);
|
||||
|
||||
Ptrs[i] = p;
|
||||
}
|
||||
|
||||
P2 = (ID2) ? SerializeTrait<T2>::Materialize(*this) : NULL;
|
||||
if (ID2 && A2) RegisterPtr(ID2,P2);
|
||||
|
||||
P3 = (ID3) ? SerializeTrait<T3>::Materialize(*this) : NULL;
|
||||
if (ID3 && A3) RegisterPtr(ID3,P3);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
@ -93,6 +93,23 @@ public:
|
||||
for (unsigned i = 0; i < NumPtrs; ++i)
|
||||
if (Ptrs[i]) SerializeTrait<T>::Emit(*this,*Ptrs[i]);
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename T3>
|
||||
void BatchEmitOwnedPtrs(unsigned NumT1Ptrs, T1* const * Ptrs,
|
||||
T2* p2, T3* p3) {
|
||||
|
||||
for (unsigned i = 0; i < NumT1Ptrs; ++i)
|
||||
EmitPtr(Ptrs[i]);
|
||||
|
||||
EmitPtr(p2);
|
||||
EmitPtr(p3);
|
||||
|
||||
for (unsigned i = 0; i < NumT1Ptrs; ++i)
|
||||
if (Ptrs[i]) SerializeTrait<T1>::Emit(*this,*Ptrs[i]);
|
||||
|
||||
if (p2) SerializeTrait<T2>::Emit(*this,*p2);
|
||||
if (p3) SerializeTrait<T3>::Emit(*this,*p3);
|
||||
}
|
||||
|
||||
bool isRegistered(const void* p) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user