[PATCH] D99344: [Analyzer] Track RValue expressions

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 25 08:22:11 PDT 2021


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 EnableNullFPSuppression) {
+  if (!E->isRValue())
+    return;
+  const ExplodedNode *RVNode = findNodeForExpression(InputNode, E);
----------------
I think this should become an assertion and the caller should ensure that `E` is actually an r-value


================
Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1950
+    const llvm::APSInt &Zero = BVF.getValue(0, BVF.getContext().IntTy);
+    // Do the comparison with the same canonical ASPInt.
+    return CI->getValue() == BVF.Convert(CI->getValue(), Zero);
----------------
`APSInt`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99344/new/

https://reviews.llvm.org/D99344



More information about the cfe-commits mailing list