diff options
| author | Artem Dergachev <artem.dergachev@gmail.com> | 2019-08-28 18:44:38 +0000 |
|---|---|---|
| committer | Artem Dergachev <artem.dergachev@gmail.com> | 2019-08-28 18:44:38 +0000 |
| commit | 630f7daf80fe36d3aa4a9ebe60e7abefae514bba (patch) | |
| tree | 476edc9fbf1518b032ec8188114f17e501780205 /clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | |
| parent | 0909a392f318872a1eacbdc9a6044cb437095a11 (diff) | |
| download | bcm5719-llvm-630f7daf80fe36d3aa4a9ebe60e7abefae514bba.tar.gz bcm5719-llvm-630f7daf80fe36d3aa4a9ebe60e7abefae514bba.zip | |
[analyzer] Fix analyzer warnings on analyzer.
Write tests for the actual crash that was found. Write comments and refactor
code around 17 style bugs and suppress 3 false positives.
Differential Revision: https://reviews.llvm.org/D66847
llvm-svn: 370246
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp index f436650fbdd..02a398c77ac 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -850,8 +850,7 @@ VisitOffsetOfExpr(const OffsetOfExpr *OOE, if (OOE->EvaluateAsInt(Result, getContext())) { APSInt IV = Result.Val.getInt(); assert(IV.getBitWidth() == getContext().getTypeSize(OOE->getType())); - assert(OOE->getType()->isBuiltinType()); - assert(OOE->getType()->getAs<BuiltinType>()->isInteger()); + assert(OOE->getType()->castAs<BuiltinType>()->isInteger()); assert(IV.isSigned() == OOE->getType()->isSignedIntegerType()); SVal X = svalBuilder.makeIntVal(IV); B.generateNode(OOE, Pred, |

