[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-30 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. martong marked an inline comment as done. Closed by commit rGefa7df1682c2: [Analyzer] Track RValue expressions (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-30 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. land it Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1938 + ProgramStateRef RVState = RVNode->getState(); + SVal V = RVState->getSValAsScalarOrLoc(

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1958-1959 + EnableNullFPSuppression); + } else { // Track only the LHS of divisions. +if (LHSV.isZeroConstant(

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 334093. martong added a comment. - Update comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99344/new/ https://reviews.llvm.org/D99344 Files: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp clang

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-30 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1958-1959 + EnableNullFPSuppression); + } else { // Track only the LHS of divisions. +if (LHSV.isZeroConstant()) + trackExpressionValue(InputNode,

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-29 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1944-1945 +return; + if (!BO->isMultiplicativeOp()) +return; + steakhal wrote: > There are only 3 multiplicative op

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-29 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 333848. martong added a comment. - Remove handling of assignment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99344/new/ https://reviews.llvm.org/D99344 Files: clang/lib/StaticAnalyzer/Core/BugReporterVisit

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-26 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Some minor logical issues inline. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1944-1945 +return; + if (!BO->isMultiplicativeOp()) +return; + There are only 3 multiplicative operators: ``` BINARY_OPERATION

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Guys, thanks for the review! :) Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1945 + + auto IsZero = [&BVF](const Optional &CI) { +if (!CI) NoQ wrote: > `SVal::isZeroConstant()` please ^.^ Yeah good catch, I wis

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 333508. martong marked 5 inline comments as done. martong added a comment. - Use isZeroConstant() - Make trackRValueExpression private (static function) - Fix clang-tidy report: auto *BO ---> const auto *BO Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-25 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. I think this is a good targeted fix for that problem we've discussed, demonstrated by tests. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:119-124 +/// Attempts to add visitors to track an RValue expression back to

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:119-124 +/// Attempts to add visitors to track an RValue expression back to its point of +/// origin. Works similarly to

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 47. martong added a comment. - Assert in the callee and check in the caller - Fix typo in comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99344/new/ https://reviews.llvm.org/D99344 Files: clang/inc

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 46. martong added a comment. - Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99344/new/ https://reviews.llvm.org/D99344 Files: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisito

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. I really like it. Looks good. I'm letting someone else accept this as I've not really touched the trackExpression parts. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:119-124 +/// Attempts to add visitors to tr

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-25 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added a comment. From the first glance, everything is looking good! Thanks for addressing this! But I still need to have a deeper look. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1932-1933 +bool EnableNu

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, NoQ, vsavchenko, Szelethus. Herald added subscribers: ASDenysPetrov, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. martong requested review of this