forked from OSchip/llvm-project
clang/lib/Analysis/CFG.cpp: Fix memory leak since r153297.
evaluateAsBooleanConditionNoCache(S) might update the map and invalidate the iterator. llvm-svn: 153406
This commit is contained in:
parent
2121199241
commit
f0434b09fc
|
|
@ -457,8 +457,11 @@ private:
|
|||
CachedBoolEvals.insert(std::make_pair(S, TryResult()));
|
||||
if (!Inserted)
|
||||
return I->second; // already in map;
|
||||
|
||||
return (I->second = evaluateAsBooleanConditionNoCache(S));
|
||||
|
||||
// Retrieve result at first, or the map might be updated.
|
||||
TryResult Result = evaluateAsBooleanConditionNoCache(S);
|
||||
CachedBoolEvals[S] = Result; // update or insert
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue