[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-25 Thread Leslie Zhai via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL301384: [analyzer] Teach the MallocChecker about Glib API for two arguments (authored by xiangzhai). Changed prior to commit: https://reviews.llvm.org/D30771?vs=96101&id=96670#toc Repository: rL LLVM

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-25 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki accepted this revision. danielmarjamaki added a comment. This revision is now accepted and ready to land. If you have svn write permission then please do it. If you need svn write permission, please see http://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access Repositor

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-25 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai added a comment. Hi Artem, Could I commit this patch? thanks! Regards, Leslie Zhai Repository: rL LLVM https://reviews.llvm.org/D30771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-25 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision now requires changes to proceed. This looks great, thanks a lot! Repository: rL LLVM https://reviews.llvm.org/D30771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lis

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-20 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai added a comment. Never mind :) Repository: rL LLVM https://reviews.llvm.org/D30771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-20 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added a comment. you can ignore my comment ... LGTM I don't want to accept this revision. Hopefully NoQ or somebody else can do that. Repository: rL LLVM https://reviews.llvm.org/D30771 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-20 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 96101. xiangzhai added a comment. Further reduce redundant code. Repository: rL LLVM https://reviews.llvm.org/D30771 Files: lib/StaticAnalyzer/Checkers/MallocChecker.cpp test/Analysis/gmalloc.c Index: test/Analysis/gmalloc.c ==

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-20 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added a comment. I don't have further comments except that I would personally rewrite: // Get the value of the size argument. SVal TotalSize = State->getSVal(Arg1, LCtx); if (SuffixWithN) { const Expr *Arg2 = CE->getArg(2); TotalSize = evalMulForBufferSize(C, Arg1, A

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-20 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 96084. xiangzhai added a comment. Further reduce redundant code. Repository: rL LLVM https://reviews.llvm.org/D30771 Files: lib/StaticAnalyzer/Checkers/MallocChecker.cpp test/Analysis/gmalloc.c Index: test/Analysis/gmalloc.c ==

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-20 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:337 + const Expr *BlockBytes, + ProgramStateRef State); static ProgramStateRef CallocMem(CheckerContext &C, const Call

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-20 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:337 + const Expr *BlockBytes, + ProgramStateRef State); static ProgramStateRef CallocMem(CheckerContext &C, cons

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-19 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai marked an inline comment as done. xiangzhai added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:788 +SVal MallocChecker::SValBinMulOp(CheckerContext &C, const Expr *Blocks, + const Expr *BlockBytes, ProgramS

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-19 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 95894. xiangzhai added a comment. `SValBinMulOp` -> `evalMulForBufferSize` Repository: rL LLVM https://reviews.llvm.org/D30771 Files: lib/StaticAnalyzer/Checkers/MallocChecker.cpp test/Analysis/gmalloc.c Index: test/Analysis/gmalloc.c

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-19 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:788 +SVal MallocChecker::SValBinMulOp(CheckerContext &C, const Expr *Blocks, + const Expr *BlockBytes, ProgramStateRef State) { dan

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-19 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai added a comment. Hi Daniel, I respect you! the father of cppcheck and KDE's buildbot use cppcheck for example Static Analysis K3B thanks for your great job! Regards, Leslie Zhai Repository:

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-19 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki added a comment. > I hold the view that I need to respect original developers' code, and it need > a Global Patch for Capital variable, just like KDE's Use nullptr everywhere Yes I was too picky. Please respect the original developers' code. Comment at: lib/St

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-19 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 95887. xiangzhai added a comment. Hi Artem, Thanks for your review! I updated my patch, please review it. Regards, Leslie Zhai Repository: rL LLVM https://reviews.llvm.org/D30771 Files: lib/StaticAnalyzer/Checkers/MallocChecker.cpp test/Analysis/

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Yay, now that's a lot cleaner! Regarding style, recently we tend to ask for updating the style in the new code, and i don't think the Golden Rule (http://llvm.org/docs/CodingStandards.html#introduction) does much in our case, but i don't have a strong opinion on that. Mayb

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-19 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 95880. Repository: rL LLVM https://reviews.llvm.org/D30771 Files: lib/StaticAnalyzer/Checkers/MallocChecker.cpp test/Analysis/gmalloc.c Index: test/Analysis/gmalloc.c === --- test/Analy

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-19 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 95874. xiangzhai added a comment. Hi David, Thanks for your review! I updated my patch as you suggested! Please review it, thanks a lot! but I argue that: > I have the feeling this should be renamed. Since its purpose is to calculate > the total size ma

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-19 Thread Daniel Marjamäki via Phabricator via cfe-commits
danielmarjamaki requested changes to this revision. danielmarjamaki added inline comments. This revision now requires changes to proceed. Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:788 +SVal MallocChecker::SValBinMulOp(CheckerContext &C, const Expr *Blocks, +

[PATCH] D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments

2017-04-18 Thread Leslie Zhai via Phabricator via cfe-commits
xiangzhai updated this revision to Diff 95684. xiangzhai added a subscriber: cfe-commits. xiangzhai added a comment. Hi Artem, I updated my patch as you suggested: never using `Arg1Val` after `TotalSize` is computed, on all branches. please review it, thanks a lot! Regards, Leslie Zhai Reposi