[PATCH] D105273: [analyzer] Introduce range-based reasoning for subtraction operator

Manas Gupta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 2 11:49:36 PDT 2021


manas added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1485
+  if (ResultType.isUnsigned() ||
+      ((LHS.From() >= 0 && RHS.From() < 0) &&
+       (LHS.To() >= 0 && RHS.To() < 0)) ||
----------------
@vsavchenko one thing crossed my mind is that, shouldn't I compare `From` and `To` values with  `llvm::APSInt Zero = ValueFactory.getAPSIntType(T).getZeroValue()` instead of literal `0`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105273



More information about the cfe-commits mailing list