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

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 1 05:15:54 PST 2024


=?utf-8?q?DonĂ¡t?= Nagy <donat.nagy at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/83545 at github.com>


================
@@ -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
----------------
NagyDonat wrote:

I'm mentioning them separately because these are separate cases in this function. (It may check either "value < threshold" or "value == threshold" depending on the last argument.)

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


More information about the cfe-commits mailing list