summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-04-27 05:34:09 +0000
committerTed Kremenek <kremenek@apple.com>2011-04-27 05:34:09 +0000
commit08b434f4503ec60b351bff9a7aeca26e5b6dfa4b (patch)
tree71e594048a19c2fe8d7232e7c5673912a7f8f3ef /clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
parent938e4a89dd251bbdd514e712f9bbfc36b184bba4 (diff)
downloadbcm5719-llvm-08b434f4503ec60b351bff9a7aeca26e5b6dfa4b.tar.gz
bcm5719-llvm-08b434f4503ec60b351bff9a7aeca26e5b6dfa4b.zip
Allow 'Environment::getSVal()' to allow an optional way for checkers to do a direct lookup to values bound to expressions, without
resulting to lazy logic. This is critical for the OSAtomicChecker that does a simulated load on any arbitrary expression. llvm-svn: 130292
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
index 6a4f1926f01..7262bc36404 100644
--- a/clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
@@ -127,7 +127,12 @@ bool OSAtomicChecker::evalOSAtomicCompareAndSwap(CheckerContext &C,
ExplodedNode *N = *I;
const GRState *stateLoad = N->getState();
- SVal theValueVal_untested = stateLoad->getSVal(theValueExpr);
+
+ // Use direct bindings from the environment since we are forcing a load
+ // from a location that the Environment would typically not be used
+ // to bind a value.
+ SVal theValueVal_untested = stateLoad->getSVal(theValueExpr, true);
+
SVal oldValueVal_untested = stateLoad->getSVal(oldValueExpr);
// FIXME: Issue an error.
OpenPOWER on IntegriCloud