[clang] [clang][analyzer] Remove array bounds check from PointerSubChecker (PR #102580)
Donát Nagy via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 9 01:35:02 PDT 2024
================
@@ -2501,7 +2501,14 @@ alpha.core.PointerSub (C)
Check for pointer subtractions on two pointers pointing to different memory
chunks. According to the C standard §6.5.6 only subtraction of pointers that
point into (or one past the end) the same array object is valid (for this
-purpose non-array variables are like arrays of size 1).
+purpose non-array variables are like arrays of size 1). This checker only
+searches for different memory objects at subtraction, but does not check if the
+array index is correct (
+:ref:`alpha.security.ArrayBoundsV2 <alpha-security-ArrayBoundsV2>` checks the
+index to some extent).
----------------
NagyDonat wrote:
```suggestion
reports subtraction between different memory objects and does not check whether
the index (or more generally, memory offset) is within bounds. Bounds checking
is done by :ref:`alpha.security.ArrayBoundV2 <alpha-security-ArrayBoundV2>`.
```
https://github.com/llvm/llvm-project/pull/102580
More information about the cfe-commits
mailing list