@@ -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 specific
108+ 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)
@@ -2919,41 +2954,6 @@ Check for assignment of a fixed address to a pointer.
29192954 p = (int *) 0x10000; // warn
29202955 }
29212956
2922- .. _alpha-core-FixedAddressDereference :
2923-
2924- alpha.core .FixedAddressDereference (C, C++, ObjC)
2925- """""""""""""""""""""""""""""""""""""""""""""""""
2926- Check for dereferences of fixed addresses.
2927-
2928- A pointer contains a fixed address if it was set to a hard-coded value or it
2929- becomes otherwise obvious that at that point it can have only a single specific
2930- value.
2931-
2932- .. code-block :: c
2933-
2934- void test1() {
2935- int *p = (int *)0x020;
2936- int x = p[0]; // warn
2937- }
2938-
2939- void test2(int *p) {
2940- if (p == (int *)-1)
2941- *p = 0; // warn
2942- }
2943-
2944- void test3() {
2945- int (*p_function)(char, char);
2946- p_function = (int (*)(char, char))0x04080;
2947- int x = (*p_function)('x', 'y'); // NO warning yet at functon pointer calls
2948- }
2949-
2950- If the analyzer option ``suppress-dereferences-from-any-address-space `` is set
2951- to true (the default value), then this checker never reports dereference of
2952- pointers with a specified address space. If the option is set to false, then
2953- reports from the specific x86 address spaces 256, 257 and 258 are still
2954- suppressed, but fixed address dereferences from other address spaces are
2955- reported.
2956-
29572957 .. _alpha-core-PointerArithm :
29582958
29592959alpha.core .PointerArithm (C)
0 commit comments