[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 21 08:28:05 PST 2025


================
@@ -170,6 +157,16 @@ disable this behavior with the option
    obj->x = 1; // warn
  }
 
+Null pointer dereferences of pointers with address spaces are not always defined
+as error. Specifically on x86/x86-64 target if the pointer address space is
+256 (x86 GS Segment), 257 (x86 FS Segment), or 258 (x86 SS Segment), a null
+dereference is not defined as error. See `X86/X86-64 Language Extensions
+<https://clang.llvm.org/docs/LanguageExtensions.html#memory-references-to-specified-segments>`__
+for reference. The ``suppress-all-address-spaces`` configuration option can be
+used to control if null dereferences with any address space or only with the
+specific x86 address spaces 256, 257, 258 are excluded from reporting as error.
+The default is all address spaces.
----------------
NagyDonat wrote:

```suggestion
for reference.

If the analyzer option ``suppress-all-address-spaces`` is set to true (the
default value), then this checker never reports dereference of pointers with a
specified address space. If the option is set to false, then reports from the
specific x86 address spaces 256, 257 and 258 are still suppressed, but null
dereferences from other address spaces are reported.
```

I think it is better to mention "(the default value)" immediately when you describe it.

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


More information about the cfe-commits mailing list