diff options
author | Ismail Pazarbasi <ismail.pazarbasi@gmail.com> | 2015-09-22 19:33:15 +0000 |
---|---|---|
committer | Ismail Pazarbasi <ismail.pazarbasi@gmail.com> | 2015-09-22 19:33:15 +0000 |
commit | d60db64e7dd4b430d74d883dfa8cb84c22c336c0 (patch) | |
tree | cc31d47025ed6cf6beab9114796bb44c204b759d /clang/lib/StaticAnalyzer/Core/Environment.cpp | |
parent | 66aa3a7f9e250d623bf89e11c32b56c47f025676 (diff) | |
download | bcm5719-llvm-d60db64e7dd4b430d74d883dfa8cb84c22c336c0.tar.gz bcm5719-llvm-d60db64e7dd4b430d74d883dfa8cb84c22c336c0.zip |
Analyzer: Teach analyzer how to handle TypeTraitExpr
Summary:
`TypeTraitExpr`s are not supported by the ExprEngine today. Analyzer
creates a sink, and aborts the block. Therefore, certain bugs that
involve type traits intrinsics cannot be detected (see PR24710).
This patch creates boolean `SVal`s for `TypeTraitExpr`s, which are
evaluated by the compiler.
Test within the patch is a summary of PR24710.
Reviewers: zaks.anna, dcoughlin, krememek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D12482
llvm-svn: 248314
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/Environment.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/Environment.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/Environment.cpp b/clang/lib/StaticAnalyzer/Core/Environment.cpp index 508f5d31196..d55858db576 100644 --- a/clang/lib/StaticAnalyzer/Core/Environment.cpp +++ b/clang/lib/StaticAnalyzer/Core/Environment.cpp @@ -90,6 +90,7 @@ SVal Environment::getSVal(const EnvironmentEntry &Entry, case Stmt::CXXNullPtrLiteralExprClass: case Stmt::ObjCStringLiteralClass: case Stmt::StringLiteralClass: + case Stmt::TypeTraitExprClass: // Known constants; defer to SValBuilder. return svalBuilder.getConstantVal(cast<Expr>(S)).getValue(); |