summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-09-12 17:56:08 +0000
committerAnna Zaks <ganna@apple.com>2011-09-12 17:56:08 +0000
commit295208d744ec2be2537953f2acd4159a0114bd45 (patch)
tree5c51cd0dfdcefd720a65d26846be2eb343ed2580 /clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
parent964c186ffe792c43182f7a1599bb5992ffba42a8 (diff)
downloadbcm5719-llvm-295208d744ec2be2537953f2acd4159a0114bd45.tar.gz
bcm5719-llvm-295208d744ec2be2537953f2acd4159a0114bd45.zip
[analyzer] Fix a new failure encountered while building Adium exposed as a result of r138196(radar://10087620). ObjectiveC property of type int has a value of type ObjCPropRef, which is a Loc.
llvm-svn: 139507
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/SValBuilder.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/SValBuilder.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
index e17f0bee20d..ebf7ae2fd4b 100644
--- a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
+++ b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp
@@ -213,8 +213,13 @@ SVal SValBuilder::evalCast(SVal val, QualType castTy, QualType originalTy) {
return UnknownVal();
// Check for casts from integers to integers.
- if (castTy->isIntegerType() && originalTy->isIntegerType())
- return evalCastFromNonLoc(cast<NonLoc>(val), castTy);
+ if (castTy->isIntegerType() && originalTy->isIntegerType()) {
+ if (isa<Loc>(val))
+ // This can be a cast to ObjC property of type int.
+ return evalCastFromLoc(cast<Loc>(val), castTy);
+ else
+ return evalCastFromNonLoc(cast<NonLoc>(val), castTy);
+ }
// Check for casts from pointers to integers.
if (castTy->isIntegerType() && Loc::isLocType(originalTy))
OpenPOWER on IntegriCloud