mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
Fixed hack in BatchReadOwnedPtrs to no longer use the array of pointers passed in for
deserialization as a temporary location for storing serialized pointer identifiers. The definition of SerializedPtrID will likely change significantly in the future, and the current implementation caused compilation errors on some 64-bit machines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43983 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -126,6 +126,7 @@ private:
|
|||||||
unsigned AbbrevNo;
|
unsigned AbbrevNo;
|
||||||
unsigned RecordCode;
|
unsigned RecordCode;
|
||||||
Location StreamStart;
|
Location StreamStart;
|
||||||
|
std::vector<SerializedPtrID> BatchIDVec;
|
||||||
|
|
||||||
//===----------------------------------------------------------===//
|
//===----------------------------------------------------------===//
|
||||||
// Public Interface.
|
// Public Interface.
|
||||||
@@ -213,10 +214,11 @@ public:
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void BatchReadOwnedPtrs(unsigned NumPtrs, T** Ptrs, bool AutoRegister=true) {
|
void BatchReadOwnedPtrs(unsigned NumPtrs, T** Ptrs, bool AutoRegister=true) {
|
||||||
for (unsigned i = 0; i < NumPtrs; ++i)
|
for (unsigned i = 0; i < NumPtrs; ++i)
|
||||||
reinterpret_cast<SerializedPtrID&>(Ptrs[i]) = ReadPtrID();
|
BatchIDVec.push_back(ReadPtrID());
|
||||||
|
|
||||||
for (unsigned i = 0; i < NumPtrs; ++i) {
|
for (unsigned i = 0; i < NumPtrs; ++i) {
|
||||||
SerializedPtrID PtrID = reinterpret_cast<SerializedPtrID>(Ptrs[i]);
|
SerializedPtrID& PtrID = BatchIDVec[i];
|
||||||
|
|
||||||
T* p = PtrID ? SerializeTrait<T>::Materialize(*this) : NULL;
|
T* p = PtrID ? SerializeTrait<T>::Materialize(*this) : NULL;
|
||||||
|
|
||||||
if (PtrID && AutoRegister)
|
if (PtrID && AutoRegister)
|
||||||
|
Reference in New Issue
Block a user