@@ -97,6 +97,41 @@ core.DivideZero (C, C++, ObjC)
9797.. literalinclude :: checkers/dividezero_example.c
9898 :language: c
9999
100+ .. _core-FixedAddressDereference :
101+
102+ core.FixedAddressDereference (C, C++, ObjC)
103+ """""""""""""""""""""""""""""""""""""""""""
104+ Check for dereferences of fixed addresses.
105+
106+ A pointer contains a fixed address if it was set to a hard-coded value or it
107+ becomes otherwise obvious that at that point it can have only a single fixed
108+ numerical value.
109+
110+ .. code-block :: c
111+
112+ void test1() {
113+ int *p = (int *)0x020;
114+ int x = p[0]; // warn
115+ }
116+
117+ void test2(int *p) {
118+ if (p == (int *)-1)
119+ *p = 0; // warn
120+ }
121+
122+ void test3() {
123+ int (*p_function)(char, char);
124+ p_function = (int (*)(char, char))0x04080;
125+ int x = (*p_function)('x', 'y'); // NO warning yet at functon pointer calls
126+ }
127+
128+ If the analyzer option ``suppress-dereferences-from-any-address-space `` is set
129+ to true (the default value), then this checker never reports dereference of
130+ pointers with a specified address space. If the option is set to false, then
131+ reports from the specific x86 address spaces 256, 257 and 258 are still
132+ suppressed, but fixed address dereferences from other address spaces are
133+ reported.
134+
100135.. _core-NonNullParamChecker :
101136
102137core.NonNullParamChecker (C, C++, ObjC)
@@ -2971,41 +3006,6 @@ Check for assignment of a fixed address to a pointer.
29713006 p = (int *) 0x10000; // warn
29723007 }
29733008
2974- .. _alpha-core-FixedAddressDereference :
2975-
2976- alpha.core .FixedAddressDereference (C, C++, ObjC)
2977- """""""""""""""""""""""""""""""""""""""""""""""""
2978- Check for dereferences of fixed addresses.
2979-
2980- A pointer contains a fixed address if it was set to a hard-coded value or it
2981- becomes otherwise obvious that at that point it can have only a single specific
2982- value.
2983-
2984- .. code-block :: c
2985-
2986- void test1() {
2987- int *p = (int *)0x020;
2988- int x = p[0]; // warn
2989- }
2990-
2991- void test2(int *p) {
2992- if (p == (int *)-1)
2993- *p = 0; // warn
2994- }
2995-
2996- void test3() {
2997- int (*p_function)(char, char);
2998- p_function = (int (*)(char, char))0x04080;
2999- int x = (*p_function)('x', 'y'); // NO warning yet at functon pointer calls
3000- }
3001-
3002- If the analyzer option ``suppress-dereferences-from-any-address-space `` is set
3003- to true (the default value), then this checker never reports dereference of
3004- pointers with a specified address space. If the option is set to false, then
3005- reports from the specific x86 address spaces 256, 257 and 258 are still
3006- suppressed, but fixed address dereferences from other address spaces are
3007- reported.
3008-
30093009 .. _alpha-core-PointerArithm :
30103010
30113011alpha.core .PointerArithm (C)
0 commit comments