diff options
author | Anna Zaks <ganna@apple.com> | 2013-05-28 22:32:08 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2013-05-28 22:32:08 +0000 |
commit | 6477e97af73a6bc036888d68b79d919f8b11cd2a (patch) | |
tree | 2f658478a5f9f5d40d0476f0ecba36d6020251a1 /clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | |
parent | 0259300325d0816219e3816659b1831375950538 (diff) | |
download | bcm5719-llvm-6477e97af73a6bc036888d68b79d919f8b11cd2a.tar.gz bcm5719-llvm-6477e97af73a6bc036888d68b79d919f8b11cd2a.zip |
[analyzer] Re-enable reasoning about CK_LValueBitCast
It’s important for us to reason about the cast as it is used in std::addressof. The reason we did not
handle the cast previously was a crash on a test case (see commit r157478). The crash was in
processing array to pointer decay when the region type was not an array. Address the issue, by
just returning an unknown in that case.
llvm-svn: 182808
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp index 67aeab60033..84872675928 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -309,7 +309,8 @@ void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, case CK_BlockPointerToObjCPointerCast: case CK_AnyPointerToBlockPointerCast: case CK_ObjCObjectLValueCast: - case CK_ZeroToOCLEvent: { + case CK_ZeroToOCLEvent: + case CK_LValueBitCast: { // Delegate to SValBuilder to process. SVal V = state->getSVal(Ex, LCtx); V = svalBuilder.evalCast(V, T, ExTy); @@ -381,8 +382,7 @@ void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, case CK_BaseToDerivedMemberPointer: case CK_DerivedToBaseMemberPointer: case CK_ReinterpretMemberPointer: - case CK_VectorSplat: - case CK_LValueBitCast: { + case CK_VectorSplat: { // Recover some path-sensitivty by conjuring a new value. QualType resultType = CastE->getType(); if (CastE->isGLValue()) |