[PATCH] D30157: [analyzer] Improve valist check

2017-03-07 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL297153: [analyzer] Improve valist checks and move it out from alpha state. (authored by xazax). Changed prior to commit: https://reviews.llvm.org/D30157?vs=90676&id=90855#toc Repository: rL LLVM htt

[PATCH] D30157: [analyzer] Improve valist check

2017-03-07 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. It's great to see things move out of alpha and finally become actually accessible to the majority of users. Thanks! https://reviews.llvm.org/D30157 __

[PATCH] D30157: [analyzer] Improve valist check

2017-03-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D30157#689374, @danielmarjamaki wrote: > I am running this checker right now on various projects. Here are currently > seen results.. https://drive.google.com/open?id=0BykPmWrCOxt2STZMOXZ5OGlwM3c > > Feel free to look at it and see if there

[PATCH] D30157: [analyzer] Improve valist check

2017-03-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 90676. xazax.hun marked an inline comment as done. xazax.hun added a comment. - Improve the readability of test files. - Rebased on latest ToT. https://reviews.llvm.org/D30157 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer

[PATCH] D30157: [analyzer] Improve valist check

2017-03-01 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added inline comments. Comment at: test/Analysis/valist-uninitialized-no-undef.c:25 + va_list va; + vprintf(isstring ? "%s" : "%d", va); //expected-warning{{Function 'vprintf' is called with an uninitialized va_list argument}} expected-note{{Function 'vprintf' is ca

[PATCH] D30157: [analyzer] Improve valist check

2017-03-01 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added a comment. I am running this checker right now on various projects. Here are currently seen results.. https://drive.google.com/open?id=0BykPmWrCOxt2STZMOXZ5OGlwM3c Feel free to look at it and see if there are FPs or TPs. https://reviews.llvm.org/D30157

[PATCH] D30157: [analyzer] Improve valist check

2017-02-27 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 89857. xazax.hun edited the summary of this revision. xazax.hun added a comment. - Move the check out of alpha. https://reviews.llvm.org/D30157 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/ValistChecker.cpp te

[PATCH] D30157: [analyzer] Improve valist check

2017-02-25 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 89780. xazax.hun added a comment. - Minor style improvement. https://reviews.llvm.org/D30157 Files: lib/StaticAnalyzer/Checkers/ValistChecker.cpp test/Analysis/valist-uninitialized-no-undef.c test/Analysis/valist-uninitialized.c test/Analysis/vali

[PATCH] D30157: [analyzer] Improve valist check

2017-02-24 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added inline comments. Comment at: lib/StaticAnalyzer/Checkers/ValistChecker.cpp:189 + const auto *EReg = dyn_cast_or_null(Reg); + return EReg && VaListModelledAsArray ? EReg->getSuperRegion() : Reg; +} I would personally recommend parentheses a

[PATCH] D30157: [analyzer] Improve valist check

2017-02-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: test/Analysis/valist-uninitialized-no-undef.c:19 + // FIXME: There should be no warning for this. + (void)va_arg(*fst, int); // expected-warning{{va_arg() is called on an uninitialized va_list}} expected-note{{va_arg() is called on

[PATCH] D30157: [analyzer] Improve valist check

2017-02-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 89187. xazax.hun marked 3 inline comments as done. xazax.hun added a comment. - Fixed a comment. https://reviews.llvm.org/D30157 Files: lib/StaticAnalyzer/Checkers/ValistChecker.cpp test/Analysis/valist-uninitialized-no-undef.c test/Analysis/valist-

[PATCH] D30157: [analyzer] Improve valist check

2017-02-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun marked 3 inline comments as done. xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Checkers/ValistChecker.cpp:178 +VaListModelledAsArray = Cast->getCastKind() == CK_ArrayToPointerDecay; + const MemRegion *Reg = SV.getAsRegion(); + if (const auto *De

[PATCH] D30157: [analyzer] Improve valist check

2017-02-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 89185. xazax.hun added a comment. - Address some review comments. - Add some additional tests. - Fixed some false positives (checking for symbolic values for va_copy and more robust detection of which valist model is used by the platform) - I have run the c

[PATCH] D30157: [analyzer] Improve valist check

2017-02-20 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/ValistChecker.cpp:178 +VaListModelledAsArray = Cast->getCastKind() == CK_ArrayToPointerDecay; + const MemRegion *Reg = SV.getAsRegion(); + if (const auto *DeclReg = Reg->getAs()) { I suspect

[PATCH] D30157: [analyzer] Improve valist check

2017-02-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision. This patch makes the valist check more robust to the different kind of ASTs that are generated on different platforms: Generated on x86_64-pc-linux-gnu: |-TypedefDecl 0x1d07a40 <> implicit __builtin_ms_va_list 'char *' | `-PointerType 0x1d07a00 'char *'