summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-05-01 21:58:29 +0000
committerTed Kremenek <kremenek@apple.com>2012-05-01 21:58:29 +0000
commitf56d4f2991a79131f1670132a8bafcbdccb7e27b (patch)
tree61a0e3f6f879ab4cadc043f4c465865a74eb0805 /clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
parent2565c596316978c5658cd474710dd7696edb0dc3 (diff)
downloadbcm5719-llvm-f56d4f2991a79131f1670132a8bafcbdccb7e27b.tar.gz
bcm5719-llvm-f56d4f2991a79131f1670132a8bafcbdccb7e27b.zip
Teach SValBuilder to handle casts of symbolic pointer values to an integer twice. Fixes <rdar://problem/11212866>.
llvm-svn: 155950
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/SValBuilder.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/SValBuilder.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
index c1217e1174a..4ce9d09280f 100644
--- a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
+++ b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
@@ -336,9 +336,12 @@ SVal SValBuilder::evalCast(SVal val, QualType castTy, QualType originalTy) {
// Check for casts from a region to a specific type.
if (const MemRegion *R = val.getAsRegion()) {
+ // Handle other casts of locations to integers.
+ if (castTy->isIntegerType())
+ return evalCastFromLoc(loc::MemRegionVal(R), castTy);
+
// FIXME: We should handle the case where we strip off view layers to get
// to a desugared type.
-
if (!Loc::isLocType(castTy)) {
// FIXME: There can be gross cases where one casts the result of a function
// (that returns a pointer) to some other value that happens to fit
OpenPOWER on IntegriCloud