[clang] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

Balázs Kéri via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 20 08:01:35 PDT 2025


================
@@ -436,9 +436,9 @@ class StdLibraryFunctionsChecker
                                llvm::raw_ostream &Out) const override;
 
     ValueConstraintPtr negate() const override {
-      NotNullBufferConstraint Tmp(*this);
+      BufferNullnessConstraint Tmp(*this);
       Tmp.CannotBeNull = !this->CannotBeNull;
----------------
balazske wrote:

The purpose is to ignore the constraint of the buffer if `size == 0` is true. If size is 0 the buffer can be a null or non-null pointer, so the constraint has no effect.

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


More information about the cfe-commits mailing list