[clang] [analyzer] Improve some comments in ArrayBoundCheckerV2 (NFC) (PR #83545)

Gábor Spaits via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 1 04:05:57 PST 2024


================
@@ -301,21 +301,27 @@ compareValueToThreshold(ProgramStateRef State, NonLoc Value, NonLoc Threshold,
   // calling `evalBinOpNN`:
   if (isNegative(SVB, State, Value) && isUnsigned(SVB, Threshold)) {
     if (CheckEquality) {
-      // negative_value == unsigned_value is always false
+      // negative_value == unsigned_threshold is always false
       return {nullptr, State};
     }
-    // negative_value < unsigned_value is always false
+    // negative_value < unsigned_threshold is always true
     return {State, nullptr};
   }
   if (isUnsigned(SVB, Value) && isNegative(SVB, State, Threshold)) {
-    // unsigned_value == negative_value and unsigned_value < negative_value are
-    // both always false
+    // unsigned_value == negative_threshold and
+    // unsigned_value < negative_threshold are both always false
----------------
spaits wrote:

Just a minor nit: Wouldn't it be better to write `<=`?

https://github.com/llvm/llvm-project/pull/83545


More information about the cfe-commits mailing list