summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp
Commit message (Collapse)AuthorAgeFilesLines
* unique_ptrify BugReporter::visitorsDavid Blaikie2014-09-041-1/+2
| | | | llvm-svn: 217205
* TestAfterDivZeroChecker.cpp: Avoid member initializer. It is unsupported in ↵NAKAMURA Takumi2014-07-111-2/+2
| | | | | | msc17. llvm-svn: 212789
* [analyzer] Check for code testing a variable for 0 after using it as a ↵Jordan Rose2014-07-101-0/+264
denominator. This new checker, alpha.core.TestAfterDivZero, catches issues like this: int sum = ... int avg = sum / count; // potential division by zero... if (count == 0) { ... } // ...caught here Because the analyzer does not necessarily explore /all/ paths through a program, this check is restricted to only work on zero checks that immediately follow a division operation (/ % /= %=). This could later be expanded to handle checks dominated by a division operation but not necessarily in the same CFG block. Patch by Anders Rönnholm! (with very minor modifications by me) llvm-svn: 212731
OpenPOWER on IntegriCloud