diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-09-11 22:07:28 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-09-11 22:07:28 +0000 |
commit | 7020eae07673210f88e0e7b382284427db555548 (patch) | |
tree | 524fb7e6a407d21529618741a95c9f10817ecb6f /clang/lib/Analysis/BasicStore.cpp | |
parent | c74e09f6546490dfd4be03dff06a81c8fa45b08e (diff) | |
download | bcm5719-llvm-7020eae07673210f88e0e7b382284427db555548.tar.gz bcm5719-llvm-7020eae07673210f88e0e7b382284427db555548.zip |
Introduce "DefinedOrUnknownSVal" into the SVal class hierarchy, providing a way
to statically type various methods in SValuator/GRState as required either a
defined value or a defined-but-possibly-unknown value. This leads to various
logic cleanups in GRExprEngine, and lets the compiler enforce via type checking
our assumptions about what symbolic values are possibly undefined and what are
not.
Along the way, clean up some of the static analyzer diagnostics regarding the uses of uninitialized values.
llvm-svn: 81579
Diffstat (limited to 'clang/lib/Analysis/BasicStore.cpp')
-rw-r--r-- | clang/lib/Analysis/BasicStore.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Analysis/BasicStore.cpp b/clang/lib/Analysis/BasicStore.cpp index 388b2e9144d..017399f4fbd 100644 --- a/clang/lib/Analysis/BasicStore.cpp +++ b/clang/lib/Analysis/BasicStore.cpp @@ -530,9 +530,9 @@ Store BasicStoreManager::getInitialStore(const LocationContext *InitLoc) { // Initialize globals and parameters to symbolic values. // Initialize local variables to undefined. const MemRegion *R = ValMgr.getRegionManager().getVarRegion(VD, InitLoc); - SVal X = R->hasGlobalsOrParametersStorage() - ? ValMgr.getRegionValueSymbolVal(R) - : UndefinedVal(); + SVal X = UndefinedVal(); + if (R->hasGlobalsOrParametersStorage()) + X = ValMgr.getRegionValueSymbolVal(R); St = BindInternal(St, ValMgr.makeLoc(R), X); } |