diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-09-27 20:45:21 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-09-27 20:45:21 +0000 |
commit | 8780679b02bea5ab6360f3f8ebf3b221aaeda93f (patch) | |
tree | c9a0f9eb4bc2acdfb1b1f347cd0d2f85deffe238 /lib/Analysis/ValueManager.cpp | |
parent | 50755b0dcc81eed9dcf27abe9162527013f26bd4 (diff) |
Fix:
<rdar://problem/6914474> checker doesn't realize that variable might
have been assigned if a pointer to that variable was passed to another
function via a structure
The problem here was the RegionStoreManager::InvalidateRegion didn't
invalidate the bindings of invalidated regions. This required a
rewrite of this method using a worklist.
As part of this fix, changed ValueManager::getConjuredSymbolVal() to
require a 'void*' SymbolTag argument. This tag is used to
differentiate two different symbols created at the same location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ValueManager.cpp')
-rw-r--r-- | lib/Analysis/ValueManager.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Analysis/ValueManager.cpp b/lib/Analysis/ValueManager.cpp index 9c3dbdd24e..fe670e79b3 100644 --- a/lib/Analysis/ValueManager.cpp +++ b/lib/Analysis/ValueManager.cpp @@ -88,13 +88,15 @@ DefinedOrUnknownSVal ValueManager::getRegionValueSymbolVal(const MemRegion* R, return nonloc::SymbolVal(sym); } -DefinedOrUnknownSVal ValueManager::getConjuredSymbolVal(const Expr *E, unsigned Count) { +DefinedOrUnknownSVal ValueManager::getConjuredSymbolVal(const void *SymbolTag, + const Expr *E, + unsigned Count) { QualType T = E->getType(); if (!SymbolManager::canSymbolicate(T)) return UnknownVal(); - SymbolRef sym = SymMgr.getConjuredSymbol(E, Count); + SymbolRef sym = SymMgr.getConjuredSymbol(E, Count, SymbolTag); if (Loc::IsLocType(T)) return loc::MemRegionVal(MemMgr.getSymbolicRegion(sym)); @@ -102,14 +104,15 @@ DefinedOrUnknownSVal ValueManager::getConjuredSymbolVal(const Expr *E, unsigned return nonloc::SymbolVal(sym); } -DefinedOrUnknownSVal ValueManager::getConjuredSymbolVal(const Expr *E, +DefinedOrUnknownSVal ValueManager::getConjuredSymbolVal(const void *SymbolTag, + const Expr *E, QualType T, unsigned Count) { if (!SymbolManager::canSymbolicate(T)) return UnknownVal(); - SymbolRef sym = SymMgr.getConjuredSymbol(E, T, Count); + SymbolRef sym = SymMgr.getConjuredSymbol(E, T, Count, SymbolTag); if (Loc::IsLocType(T)) return loc::MemRegionVal(MemMgr.getSymbolicRegion(sym)); |