llvm.org GIT mirror llvm / 7c6ad0c
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 Ted Kremenek 12 years ago
1 changed file(s) with 4 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
125125 unsigned AbbrevNo;
126126 unsigned RecordCode;
127127 Location StreamStart;
128 std::vector BatchIDVec;
129128
130129 //===----------------------------------------------------------===//
131130 // Public Interface.
212211
213212 template
214213 void BatchReadOwnedPtrs(unsigned NumPtrs, T** Ptrs, bool AutoRegister=true) {
215 BatchIDVec.clear();
214 llvm::SmallVector BatchIDVec;
216215
217216 for (unsigned i = 0; i < NumPtrs; ++i)
218217 BatchIDVec.push_back(ReadPtrID());
233232 void BatchReadOwnedPtrs(unsigned NumT1Ptrs, T1** Ptrs, T2*& P2,
234233 bool A1=true, bool A2=true) {
235234
236 BatchIDVec.clear();
237
235 llvm::SmallVector BatchIDVec;
236
238237 for (unsigned i = 0; i < NumT1Ptrs; ++i)
239238 BatchIDVec.push_back(ReadPtrID());
240239
260259 T2*& P2, T3*& P3,
261260 bool A1=true, bool A2=true, bool A3=true) {
262261
263 BatchIDVec.clear();
262 llvm::SmallVector BatchIDVec;
264263
265264 for (unsigned i = 0; i < NumT1Ptrs; ++i)
266265 BatchIDVec.push_back(ReadPtrID());