summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-11-12 22:06:24 +0000
committerAnna Zaks <ganna@apple.com>2012-11-12 22:06:24 +0000
commit4e255b62f1e504b8773f50bf726b4c6fb56cb55f (patch)
tree11925c69f4d2e8849116a3449cbab37bdcd4835a /clang/lib
parentb1da2cb3fdb6444e9db7db0e17b3cd505771d688 (diff)
downloadbcm5719-llvm-4e255b62f1e504b8773f50bf726b4c6fb56cb55f.tar.gz
bcm5719-llvm-4e255b62f1e504b8773f50bf726b4c6fb56cb55f.zip
[analyzer] Fix a regression (from r 165079): compare canonical types.
Suppresses a leak false positive (radar://12663777). In addition, we'll need to rewrite the adjustReturnValue() method not to return UnknownVal by default, but rather assert in cases we cannot handle. To make it possible, we need to correctly handle some of the edge cases we already know about. llvm-svn: 167762
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
index 3c1c412af53..5b88a454954 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
@@ -137,6 +137,8 @@ static SVal adjustReturnValue(SVal V, QualType ExpectedTy, QualType ActualTy,
return V;
// If the types already match, don't do any unnecessary work.
+ ExpectedTy = ExpectedTy.getCanonicalType();
+ ActualTy = ActualTy.getCanonicalType();
if (ExpectedTy == ActualTy)
return V;
OpenPOWER on IntegriCloud