mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-11 10:31:40 +00:00
Fixed serious bug in BatchReadOwnedPtrs where in a chain of calls to
deserialize objects if BatchReadOwnedPtrs was called more than once in the same call chain then the second call would overwrite the SerializedPtrIDs being used by the first call. Solved this problem by making the vector that holds the pointer IDs local to a function call. Now BatchReadOwnedPtrs is reentrant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44152 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c455ebeb0c
commit
7c6ad0c06e
@ -126,7 +126,6 @@ private:
|
|||||||
unsigned AbbrevNo;
|
unsigned AbbrevNo;
|
||||||
unsigned RecordCode;
|
unsigned RecordCode;
|
||||||
Location StreamStart;
|
Location StreamStart;
|
||||||
std::vector<SerializedPtrID> BatchIDVec;
|
|
||||||
|
|
||||||
//===----------------------------------------------------------===//
|
//===----------------------------------------------------------===//
|
||||||
// Public Interface.
|
// Public Interface.
|
||||||
@ -213,7 +212,7 @@ 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) {
|
||||||
BatchIDVec.clear();
|
llvm::SmallVector<SerializedPtrID,10> BatchIDVec;
|
||||||
|
|
||||||
for (unsigned i = 0; i < NumPtrs; ++i)
|
for (unsigned i = 0; i < NumPtrs; ++i)
|
||||||
BatchIDVec.push_back(ReadPtrID());
|
BatchIDVec.push_back(ReadPtrID());
|
||||||
@ -234,8 +233,8 @@ public:
|
|||||||
void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs, T2*& P2,
|
void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs, T2*& P2,
|
||||||
bool A1=true, bool A2=true) {
|
bool A1=true, bool A2=true) {
|
||||||
|
|
||||||
BatchIDVec.clear();
|
llvm::SmallVector<SerializedPtrID,10> BatchIDVec;
|
||||||
|
|
||||||
for (unsigned i = 0; i < NumT1Ptrs; ++i)
|
for (unsigned i = 0; i < NumT1Ptrs; ++i)
|
||||||
BatchIDVec.push_back(ReadPtrID());
|
BatchIDVec.push_back(ReadPtrID());
|
||||||
|
|
||||||
@ -261,7 +260,7 @@ public:
|
|||||||
T2*& P2, T3*& P3,
|
T2*& P2, T3*& P3,
|
||||||
bool A1=true, bool A2=true, bool A3=true) {
|
bool A1=true, bool A2=true, bool A3=true) {
|
||||||
|
|
||||||
BatchIDVec.clear();
|
llvm::SmallVector<SerializedPtrID,10> BatchIDVec;
|
||||||
|
|
||||||
for (unsigned i = 0; i < NumT1Ptrs; ++i)
|
for (unsigned i = 0; i < NumT1Ptrs; ++i)
|
||||||
BatchIDVec.push_back(ReadPtrID());
|
BatchIDVec.push_back(ReadPtrID());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user