[PATCH] D80117: [analyzer] Introduce reasoning about symbolic remainder operator

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 18 09:07:35 PDT 2020


vsavchenko marked 2 inline comments as done.
vsavchenko added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:459
+    bool CoversTheWholeType =
+        (Origin.From().isMinSignedValue() || Origin.To().isMaxValue());
+
----------------
NoQ wrote:
> `(Origin.From() + 1).isMinSignedValue()` is another sufficient condition(?)
I'm sorry, I don't quite get what cases does this check cover.  Can you please explain what you have in mind?


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:462
+    if (CoversTheWholeType) {
+      return {ValueFactory.getMinValue(RangeType),
+              ValueFactory.getMaxValue(RangeType)};
----------------
NoQ wrote:
> You mean zero, right?
No, not always.  It still can be signed at this point.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80117





More information about the cfe-commits mailing list