• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s
2 // RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=plist-multi-file -analyzer-config path-diagnostics-alternate=false %s -o %t.plist
3 // RUN: FileCheck --input-file=%t.plist %s
4 
5 // Test warning about null or uninitialized pointer values used as instance member
6 // calls.
7 class TestInstanceCall {
8 public:
foo()9   void foo() {}
10 };
11 
test_ic()12 void test_ic() {
13   TestInstanceCall *p; // expected-note {{'p' declared without an initial value}}
14   p->foo(); // expected-warning {{Called C++ object pointer is uninitialized}} expected-note {{Called C++ object pointer is uninitialized}}
15 }
16 
test_ic_null()17 void test_ic_null() {
18   TestInstanceCall *p = 0; // expected-note {{'p' initialized to a null pointer value}}
19   p->foo(); // expected-warning {{Called C++ object pointer is null}} expected-note {{Called C++ object pointer is null}}
20 }
21 
test_ic_set_to_null()22 void test_ic_set_to_null() {
23   TestInstanceCall *p;
24   p = 0; // expected-note {{Null pointer value stored to 'p'}}
25   p->foo(); // expected-warning {{Called C++ object pointer is null}} expected-note {{Called C++ object pointer is null}}
26 }
27 
test_ic_null(TestInstanceCall * p)28 void test_ic_null(TestInstanceCall *p) {
29   if (!p) // expected-note {{Assuming 'p' is null}} expected-note {{Taking true branch}}
30     p->foo(); // expected-warning {{Called C++ object pointer is null}} expected-note{{Called C++ object pointer is null}}
31 }
32 
test_ic_member_ptr()33 void test_ic_member_ptr() {
34   TestInstanceCall *p = 0; // expected-note {{'p' initialized to a null pointer value}}
35   typedef void (TestInstanceCall::*IC_Ptr)();
36   IC_Ptr bar = &TestInstanceCall::foo;
37   (p->*bar)(); // expected-warning {{Called C++ object pointer is null}} expected-note{{Called C++ object pointer is null}}
38 }
39 
test_cast(const TestInstanceCall * p)40 void test_cast(const TestInstanceCall *p) {
41   if (!p) // expected-note {{Assuming 'p' is null}} expected-note {{Taking true branch}}
42     const_cast<TestInstanceCall *>(p)->foo(); // expected-warning {{Called C++ object pointer is null}} expected-note {{Called C++ object pointer is null}}
43 }
44 
45 // CHECK:  <key>diagnostics</key>
46 // CHECK-NEXT:  <array>
47 // CHECK-NEXT:   <dict>
48 // CHECK-NEXT:    <key>path</key>
49 // CHECK-NEXT:    <array>
50 // CHECK-NEXT:     <dict>
51 // CHECK-NEXT:      <key>kind</key><string>event</string>
52 // CHECK-NEXT:      <key>location</key>
53 // CHECK-NEXT:      <dict>
54 // CHECK-NEXT:       <key>line</key><integer>13</integer>
55 // CHECK-NEXT:       <key>col</key><integer>3</integer>
56 // CHECK-NEXT:       <key>file</key><integer>0</integer>
57 // CHECK-NEXT:      </dict>
58 // CHECK-NEXT:      <key>ranges</key>
59 // CHECK-NEXT:      <array>
60 // CHECK-NEXT:        <array>
61 // CHECK-NEXT:         <dict>
62 // CHECK-NEXT:          <key>line</key><integer>13</integer>
63 // CHECK-NEXT:          <key>col</key><integer>3</integer>
64 // CHECK-NEXT:          <key>file</key><integer>0</integer>
65 // CHECK-NEXT:         </dict>
66 // CHECK-NEXT:         <dict>
67 // CHECK-NEXT:          <key>line</key><integer>13</integer>
68 // CHECK-NEXT:          <key>col</key><integer>21</integer>
69 // CHECK-NEXT:          <key>file</key><integer>0</integer>
70 // CHECK-NEXT:         </dict>
71 // CHECK-NEXT:        </array>
72 // CHECK-NEXT:      </array>
73 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
74 // CHECK-NEXT:      <key>extended_message</key>
75 // CHECK-NEXT:      <string>&apos;p&apos; declared without an initial value</string>
76 // CHECK-NEXT:      <key>message</key>
77 // CHECK-NEXT:      <string>&apos;p&apos; declared without an initial value</string>
78 // CHECK-NEXT:     </dict>
79 // CHECK-NEXT:     <dict>
80 // CHECK-NEXT:      <key>kind</key><string>control</string>
81 // CHECK-NEXT:      <key>edges</key>
82 // CHECK-NEXT:       <array>
83 // CHECK-NEXT:        <dict>
84 // CHECK-NEXT:         <key>start</key>
85 // CHECK-NEXT:          <array>
86 // CHECK-NEXT:           <dict>
87 // CHECK-NEXT:            <key>line</key><integer>13</integer>
88 // CHECK-NEXT:            <key>col</key><integer>3</integer>
89 // CHECK-NEXT:            <key>file</key><integer>0</integer>
90 // CHECK-NEXT:           </dict>
91 // CHECK-NEXT:           <dict>
92 // CHECK-NEXT:            <key>line</key><integer>13</integer>
93 // CHECK-NEXT:            <key>col</key><integer>18</integer>
94 // CHECK-NEXT:            <key>file</key><integer>0</integer>
95 // CHECK-NEXT:           </dict>
96 // CHECK-NEXT:          </array>
97 // CHECK-NEXT:         <key>end</key>
98 // CHECK-NEXT:          <array>
99 // CHECK-NEXT:           <dict>
100 // CHECK-NEXT:            <key>line</key><integer>14</integer>
101 // CHECK-NEXT:            <key>col</key><integer>3</integer>
102 // CHECK-NEXT:            <key>file</key><integer>0</integer>
103 // CHECK-NEXT:           </dict>
104 // CHECK-NEXT:           <dict>
105 // CHECK-NEXT:            <key>line</key><integer>14</integer>
106 // CHECK-NEXT:            <key>col</key><integer>3</integer>
107 // CHECK-NEXT:            <key>file</key><integer>0</integer>
108 // CHECK-NEXT:           </dict>
109 // CHECK-NEXT:          </array>
110 // CHECK-NEXT:        </dict>
111 // CHECK-NEXT:       </array>
112 // CHECK-NEXT:     </dict>
113 // CHECK-NEXT:     <dict>
114 // CHECK-NEXT:      <key>kind</key><string>event</string>
115 // CHECK-NEXT:      <key>location</key>
116 // CHECK-NEXT:      <dict>
117 // CHECK-NEXT:       <key>line</key><integer>14</integer>
118 // CHECK-NEXT:       <key>col</key><integer>3</integer>
119 // CHECK-NEXT:       <key>file</key><integer>0</integer>
120 // CHECK-NEXT:      </dict>
121 // CHECK-NEXT:      <key>ranges</key>
122 // CHECK-NEXT:      <array>
123 // CHECK-NEXT:        <array>
124 // CHECK-NEXT:         <dict>
125 // CHECK-NEXT:          <key>line</key><integer>14</integer>
126 // CHECK-NEXT:          <key>col</key><integer>3</integer>
127 // CHECK-NEXT:          <key>file</key><integer>0</integer>
128 // CHECK-NEXT:         </dict>
129 // CHECK-NEXT:         <dict>
130 // CHECK-NEXT:          <key>line</key><integer>14</integer>
131 // CHECK-NEXT:          <key>col</key><integer>3</integer>
132 // CHECK-NEXT:          <key>file</key><integer>0</integer>
133 // CHECK-NEXT:         </dict>
134 // CHECK-NEXT:        </array>
135 // CHECK-NEXT:      </array>
136 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
137 // CHECK-NEXT:      <key>extended_message</key>
138 // CHECK-NEXT:      <string>Called C++ object pointer is uninitialized</string>
139 // CHECK-NEXT:      <key>message</key>
140 // CHECK-NEXT:      <string>Called C++ object pointer is uninitialized</string>
141 // CHECK-NEXT:     </dict>
142 // CHECK-NEXT:    </array>
143 // CHECK-NEXT:    <key>description</key><string>Called C++ object pointer is uninitialized</string>
144 // CHECK-NEXT:    <key>category</key><string>Logic error</string>
145 // CHECK-NEXT:    <key>type</key><string>Called C++ object pointer is uninitialized</string>
146 // CHECK-NEXT:    <key>check_name</key><string>core.CallAndMessage</string>
147 // CHECK-NEXT:    <!-- This hash is experimental and going to change! -->
148 // CHECK-NEXT:    <key>issue_hash_content_of_line_in_context</key><string>8c0cdb645ae6be246ed75941dcefd32d</string>
149 // CHECK-NEXT:   <key>issue_context_kind</key><string>function</string>
150 // CHECK-NEXT:   <key>issue_context</key><string>test_ic</string>
151 // CHECK-NEXT:   <key>issue_hash_function_offset</key><string>2</string>
152 // CHECK-NEXT:   <key>location</key>
153 // CHECK-NEXT:   <dict>
154 // CHECK-NEXT:    <key>line</key><integer>14</integer>
155 // CHECK-NEXT:    <key>col</key><integer>3</integer>
156 // CHECK-NEXT:    <key>file</key><integer>0</integer>
157 // CHECK-NEXT:   </dict>
158 // CHECK-NEXT:   </dict>
159 // CHECK-NEXT:   <dict>
160 // CHECK-NEXT:    <key>path</key>
161 // CHECK-NEXT:    <array>
162 // CHECK-NEXT:     <dict>
163 // CHECK-NEXT:      <key>kind</key><string>event</string>
164 // CHECK-NEXT:      <key>location</key>
165 // CHECK-NEXT:      <dict>
166 // CHECK-NEXT:       <key>line</key><integer>18</integer>
167 // CHECK-NEXT:       <key>col</key><integer>3</integer>
168 // CHECK-NEXT:       <key>file</key><integer>0</integer>
169 // CHECK-NEXT:      </dict>
170 // CHECK-NEXT:      <key>ranges</key>
171 // CHECK-NEXT:      <array>
172 // CHECK-NEXT:        <array>
173 // CHECK-NEXT:         <dict>
174 // CHECK-NEXT:          <key>line</key><integer>18</integer>
175 // CHECK-NEXT:          <key>col</key><integer>3</integer>
176 // CHECK-NEXT:          <key>file</key><integer>0</integer>
177 // CHECK-NEXT:         </dict>
178 // CHECK-NEXT:         <dict>
179 // CHECK-NEXT:          <key>line</key><integer>18</integer>
180 // CHECK-NEXT:          <key>col</key><integer>21</integer>
181 // CHECK-NEXT:          <key>file</key><integer>0</integer>
182 // CHECK-NEXT:         </dict>
183 // CHECK-NEXT:        </array>
184 // CHECK-NEXT:      </array>
185 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
186 // CHECK-NEXT:      <key>extended_message</key>
187 // CHECK-NEXT:      <string>&apos;p&apos; initialized to a null pointer value</string>
188 // CHECK-NEXT:      <key>message</key>
189 // CHECK-NEXT:      <string>&apos;p&apos; initialized to a null pointer value</string>
190 // CHECK-NEXT:     </dict>
191 // CHECK-NEXT:     <dict>
192 // CHECK-NEXT:      <key>kind</key><string>control</string>
193 // CHECK-NEXT:      <key>edges</key>
194 // CHECK-NEXT:       <array>
195 // CHECK-NEXT:        <dict>
196 // CHECK-NEXT:         <key>start</key>
197 // CHECK-NEXT:          <array>
198 // CHECK-NEXT:           <dict>
199 // CHECK-NEXT:            <key>line</key><integer>18</integer>
200 // CHECK-NEXT:            <key>col</key><integer>3</integer>
201 // CHECK-NEXT:            <key>file</key><integer>0</integer>
202 // CHECK-NEXT:           </dict>
203 // CHECK-NEXT:           <dict>
204 // CHECK-NEXT:            <key>line</key><integer>18</integer>
205 // CHECK-NEXT:            <key>col</key><integer>18</integer>
206 // CHECK-NEXT:            <key>file</key><integer>0</integer>
207 // CHECK-NEXT:           </dict>
208 // CHECK-NEXT:          </array>
209 // CHECK-NEXT:         <key>end</key>
210 // CHECK-NEXT:          <array>
211 // CHECK-NEXT:           <dict>
212 // CHECK-NEXT:            <key>line</key><integer>19</integer>
213 // CHECK-NEXT:            <key>col</key><integer>3</integer>
214 // CHECK-NEXT:            <key>file</key><integer>0</integer>
215 // CHECK-NEXT:           </dict>
216 // CHECK-NEXT:           <dict>
217 // CHECK-NEXT:            <key>line</key><integer>19</integer>
218 // CHECK-NEXT:            <key>col</key><integer>3</integer>
219 // CHECK-NEXT:            <key>file</key><integer>0</integer>
220 // CHECK-NEXT:           </dict>
221 // CHECK-NEXT:          </array>
222 // CHECK-NEXT:        </dict>
223 // CHECK-NEXT:       </array>
224 // CHECK-NEXT:     </dict>
225 // CHECK-NEXT:     <dict>
226 // CHECK-NEXT:      <key>kind</key><string>event</string>
227 // CHECK-NEXT:      <key>location</key>
228 // CHECK-NEXT:      <dict>
229 // CHECK-NEXT:       <key>line</key><integer>19</integer>
230 // CHECK-NEXT:       <key>col</key><integer>3</integer>
231 // CHECK-NEXT:       <key>file</key><integer>0</integer>
232 // CHECK-NEXT:      </dict>
233 // CHECK-NEXT:      <key>ranges</key>
234 // CHECK-NEXT:      <array>
235 // CHECK-NEXT:        <array>
236 // CHECK-NEXT:         <dict>
237 // CHECK-NEXT:          <key>line</key><integer>19</integer>
238 // CHECK-NEXT:          <key>col</key><integer>3</integer>
239 // CHECK-NEXT:          <key>file</key><integer>0</integer>
240 // CHECK-NEXT:         </dict>
241 // CHECK-NEXT:         <dict>
242 // CHECK-NEXT:          <key>line</key><integer>19</integer>
243 // CHECK-NEXT:          <key>col</key><integer>3</integer>
244 // CHECK-NEXT:          <key>file</key><integer>0</integer>
245 // CHECK-NEXT:         </dict>
246 // CHECK-NEXT:        </array>
247 // CHECK-NEXT:      </array>
248 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
249 // CHECK-NEXT:      <key>extended_message</key>
250 // CHECK-NEXT:      <string>Called C++ object pointer is null</string>
251 // CHECK-NEXT:      <key>message</key>
252 // CHECK-NEXT:      <string>Called C++ object pointer is null</string>
253 // CHECK-NEXT:     </dict>
254 // CHECK-NEXT:    </array>
255 // CHECK-NEXT:    <key>description</key><string>Called C++ object pointer is null</string>
256 // CHECK-NEXT:    <key>category</key><string>Logic error</string>
257 // CHECK-NEXT:    <key>type</key><string>Called C++ object pointer is null</string>
258 // CHECK-NEXT:    <key>check_name</key><string>core.CallAndMessage</string>
259 // CHECK-NEXT:    <!-- This hash is experimental and going to change! -->
260 // CHECK-NEXT:    <key>issue_hash_content_of_line_in_context</key><string>98e39ef0e4bbc0b9b2b1832285634d67</string>
261 // CHECK-NEXT:   <key>issue_context_kind</key><string>function</string>
262 // CHECK-NEXT:   <key>issue_context</key><string>test_ic_null</string>
263 // CHECK-NEXT:   <key>issue_hash_function_offset</key><string>2</string>
264 // CHECK-NEXT:   <key>location</key>
265 // CHECK-NEXT:   <dict>
266 // CHECK-NEXT:    <key>line</key><integer>19</integer>
267 // CHECK-NEXT:    <key>col</key><integer>3</integer>
268 // CHECK-NEXT:    <key>file</key><integer>0</integer>
269 // CHECK-NEXT:   </dict>
270 // CHECK-NEXT:   </dict>
271 // CHECK-NEXT:   <dict>
272 // CHECK-NEXT:    <key>path</key>
273 // CHECK-NEXT:    <array>
274 // CHECK-NEXT:     <dict>
275 // CHECK-NEXT:      <key>kind</key><string>control</string>
276 // CHECK-NEXT:      <key>edges</key>
277 // CHECK-NEXT:       <array>
278 // CHECK-NEXT:        <dict>
279 // CHECK-NEXT:         <key>start</key>
280 // CHECK-NEXT:          <array>
281 // CHECK-NEXT:           <dict>
282 // CHECK-NEXT:            <key>line</key><integer>23</integer>
283 // CHECK-NEXT:            <key>col</key><integer>3</integer>
284 // CHECK-NEXT:            <key>file</key><integer>0</integer>
285 // CHECK-NEXT:           </dict>
286 // CHECK-NEXT:           <dict>
287 // CHECK-NEXT:            <key>line</key><integer>23</integer>
288 // CHECK-NEXT:            <key>col</key><integer>18</integer>
289 // CHECK-NEXT:            <key>file</key><integer>0</integer>
290 // CHECK-NEXT:           </dict>
291 // CHECK-NEXT:          </array>
292 // CHECK-NEXT:         <key>end</key>
293 // CHECK-NEXT:          <array>
294 // CHECK-NEXT:           <dict>
295 // CHECK-NEXT:            <key>line</key><integer>24</integer>
296 // CHECK-NEXT:            <key>col</key><integer>3</integer>
297 // CHECK-NEXT:            <key>file</key><integer>0</integer>
298 // CHECK-NEXT:           </dict>
299 // CHECK-NEXT:           <dict>
300 // CHECK-NEXT:            <key>line</key><integer>24</integer>
301 // CHECK-NEXT:            <key>col</key><integer>3</integer>
302 // CHECK-NEXT:            <key>file</key><integer>0</integer>
303 // CHECK-NEXT:           </dict>
304 // CHECK-NEXT:          </array>
305 // CHECK-NEXT:        </dict>
306 // CHECK-NEXT:       </array>
307 // CHECK-NEXT:     </dict>
308 // CHECK-NEXT:     <dict>
309 // CHECK-NEXT:      <key>kind</key><string>event</string>
310 // CHECK-NEXT:      <key>location</key>
311 // CHECK-NEXT:      <dict>
312 // CHECK-NEXT:       <key>line</key><integer>24</integer>
313 // CHECK-NEXT:       <key>col</key><integer>3</integer>
314 // CHECK-NEXT:       <key>file</key><integer>0</integer>
315 // CHECK-NEXT:      </dict>
316 // CHECK-NEXT:      <key>ranges</key>
317 // CHECK-NEXT:      <array>
318 // CHECK-NEXT:        <array>
319 // CHECK-NEXT:         <dict>
320 // CHECK-NEXT:          <key>line</key><integer>24</integer>
321 // CHECK-NEXT:          <key>col</key><integer>3</integer>
322 // CHECK-NEXT:          <key>file</key><integer>0</integer>
323 // CHECK-NEXT:         </dict>
324 // CHECK-NEXT:         <dict>
325 // CHECK-NEXT:          <key>line</key><integer>24</integer>
326 // CHECK-NEXT:          <key>col</key><integer>7</integer>
327 // CHECK-NEXT:          <key>file</key><integer>0</integer>
328 // CHECK-NEXT:         </dict>
329 // CHECK-NEXT:        </array>
330 // CHECK-NEXT:      </array>
331 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
332 // CHECK-NEXT:      <key>extended_message</key>
333 // CHECK-NEXT:      <string>Null pointer value stored to &apos;p&apos;</string>
334 // CHECK-NEXT:      <key>message</key>
335 // CHECK-NEXT:      <string>Null pointer value stored to &apos;p&apos;</string>
336 // CHECK-NEXT:     </dict>
337 // CHECK-NEXT:     <dict>
338 // CHECK-NEXT:      <key>kind</key><string>control</string>
339 // CHECK-NEXT:      <key>edges</key>
340 // CHECK-NEXT:       <array>
341 // CHECK-NEXT:        <dict>
342 // CHECK-NEXT:         <key>start</key>
343 // CHECK-NEXT:          <array>
344 // CHECK-NEXT:           <dict>
345 // CHECK-NEXT:            <key>line</key><integer>24</integer>
346 // CHECK-NEXT:            <key>col</key><integer>3</integer>
347 // CHECK-NEXT:            <key>file</key><integer>0</integer>
348 // CHECK-NEXT:           </dict>
349 // CHECK-NEXT:           <dict>
350 // CHECK-NEXT:            <key>line</key><integer>24</integer>
351 // CHECK-NEXT:            <key>col</key><integer>3</integer>
352 // CHECK-NEXT:            <key>file</key><integer>0</integer>
353 // CHECK-NEXT:           </dict>
354 // CHECK-NEXT:          </array>
355 // CHECK-NEXT:         <key>end</key>
356 // CHECK-NEXT:          <array>
357 // CHECK-NEXT:           <dict>
358 // CHECK-NEXT:            <key>line</key><integer>25</integer>
359 // CHECK-NEXT:            <key>col</key><integer>3</integer>
360 // CHECK-NEXT:            <key>file</key><integer>0</integer>
361 // CHECK-NEXT:           </dict>
362 // CHECK-NEXT:           <dict>
363 // CHECK-NEXT:            <key>line</key><integer>25</integer>
364 // CHECK-NEXT:            <key>col</key><integer>3</integer>
365 // CHECK-NEXT:            <key>file</key><integer>0</integer>
366 // CHECK-NEXT:           </dict>
367 // CHECK-NEXT:          </array>
368 // CHECK-NEXT:        </dict>
369 // CHECK-NEXT:       </array>
370 // CHECK-NEXT:     </dict>
371 // CHECK-NEXT:     <dict>
372 // CHECK-NEXT:      <key>kind</key><string>event</string>
373 // CHECK-NEXT:      <key>location</key>
374 // CHECK-NEXT:      <dict>
375 // CHECK-NEXT:       <key>line</key><integer>25</integer>
376 // CHECK-NEXT:       <key>col</key><integer>3</integer>
377 // CHECK-NEXT:       <key>file</key><integer>0</integer>
378 // CHECK-NEXT:      </dict>
379 // CHECK-NEXT:      <key>ranges</key>
380 // CHECK-NEXT:      <array>
381 // CHECK-NEXT:        <array>
382 // CHECK-NEXT:         <dict>
383 // CHECK-NEXT:          <key>line</key><integer>25</integer>
384 // CHECK-NEXT:          <key>col</key><integer>3</integer>
385 // CHECK-NEXT:          <key>file</key><integer>0</integer>
386 // CHECK-NEXT:         </dict>
387 // CHECK-NEXT:         <dict>
388 // CHECK-NEXT:          <key>line</key><integer>25</integer>
389 // CHECK-NEXT:          <key>col</key><integer>3</integer>
390 // CHECK-NEXT:          <key>file</key><integer>0</integer>
391 // CHECK-NEXT:         </dict>
392 // CHECK-NEXT:        </array>
393 // CHECK-NEXT:      </array>
394 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
395 // CHECK-NEXT:      <key>extended_message</key>
396 // CHECK-NEXT:      <string>Called C++ object pointer is null</string>
397 // CHECK-NEXT:      <key>message</key>
398 // CHECK-NEXT:      <string>Called C++ object pointer is null</string>
399 // CHECK-NEXT:     </dict>
400 // CHECK-NEXT:    </array>
401 // CHECK-NEXT:    <key>description</key><string>Called C++ object pointer is null</string>
402 // CHECK-NEXT:    <key>category</key><string>Logic error</string>
403 // CHECK-NEXT:    <key>type</key><string>Called C++ object pointer is null</string>
404 // CHECK-NEXT:    <key>check_name</key><string>core.CallAndMessage</string>
405 // CHECK-NEXT:    <!-- This hash is experimental and going to change! -->
406 // CHECK-NEXT:    <key>issue_hash_content_of_line_in_context</key><string>84f3d9d5009d2ac455b46b4aae88f67f</string>
407 // CHECK-NEXT:   <key>issue_context_kind</key><string>function</string>
408 // CHECK-NEXT:   <key>issue_context</key><string>test_ic_set_to_null</string>
409 // CHECK-NEXT:   <key>issue_hash_function_offset</key><string>3</string>
410 // CHECK-NEXT:   <key>location</key>
411 // CHECK-NEXT:   <dict>
412 // CHECK-NEXT:    <key>line</key><integer>25</integer>
413 // CHECK-NEXT:    <key>col</key><integer>3</integer>
414 // CHECK-NEXT:    <key>file</key><integer>0</integer>
415 // CHECK-NEXT:   </dict>
416 // CHECK-NEXT:   </dict>
417 // CHECK-NEXT:   <dict>
418 // CHECK-NEXT:    <key>path</key>
419 // CHECK-NEXT:    <array>
420 // CHECK-NEXT:     <dict>
421 // CHECK-NEXT:      <key>kind</key><string>control</string>
422 // CHECK-NEXT:      <key>edges</key>
423 // CHECK-NEXT:       <array>
424 // CHECK-NEXT:        <dict>
425 // CHECK-NEXT:         <key>start</key>
426 // CHECK-NEXT:          <array>
427 // CHECK-NEXT:           <dict>
428 // CHECK-NEXT:            <key>line</key><integer>29</integer>
429 // CHECK-NEXT:            <key>col</key><integer>3</integer>
430 // CHECK-NEXT:            <key>file</key><integer>0</integer>
431 // CHECK-NEXT:           </dict>
432 // CHECK-NEXT:           <dict>
433 // CHECK-NEXT:            <key>line</key><integer>29</integer>
434 // CHECK-NEXT:            <key>col</key><integer>4</integer>
435 // CHECK-NEXT:            <key>file</key><integer>0</integer>
436 // CHECK-NEXT:           </dict>
437 // CHECK-NEXT:          </array>
438 // CHECK-NEXT:         <key>end</key>
439 // CHECK-NEXT:          <array>
440 // CHECK-NEXT:           <dict>
441 // CHECK-NEXT:            <key>line</key><integer>29</integer>
442 // CHECK-NEXT:            <key>col</key><integer>7</integer>
443 // CHECK-NEXT:            <key>file</key><integer>0</integer>
444 // CHECK-NEXT:           </dict>
445 // CHECK-NEXT:           <dict>
446 // CHECK-NEXT:            <key>line</key><integer>29</integer>
447 // CHECK-NEXT:            <key>col</key><integer>7</integer>
448 // CHECK-NEXT:            <key>file</key><integer>0</integer>
449 // CHECK-NEXT:           </dict>
450 // CHECK-NEXT:          </array>
451 // CHECK-NEXT:        </dict>
452 // CHECK-NEXT:       </array>
453 // CHECK-NEXT:     </dict>
454 // CHECK-NEXT:     <dict>
455 // CHECK-NEXT:      <key>kind</key><string>event</string>
456 // CHECK-NEXT:      <key>location</key>
457 // CHECK-NEXT:      <dict>
458 // CHECK-NEXT:       <key>line</key><integer>29</integer>
459 // CHECK-NEXT:       <key>col</key><integer>7</integer>
460 // CHECK-NEXT:       <key>file</key><integer>0</integer>
461 // CHECK-NEXT:      </dict>
462 // CHECK-NEXT:      <key>ranges</key>
463 // CHECK-NEXT:      <array>
464 // CHECK-NEXT:        <array>
465 // CHECK-NEXT:         <dict>
466 // CHECK-NEXT:          <key>line</key><integer>29</integer>
467 // CHECK-NEXT:          <key>col</key><integer>7</integer>
468 // CHECK-NEXT:          <key>file</key><integer>0</integer>
469 // CHECK-NEXT:         </dict>
470 // CHECK-NEXT:         <dict>
471 // CHECK-NEXT:          <key>line</key><integer>29</integer>
472 // CHECK-NEXT:          <key>col</key><integer>8</integer>
473 // CHECK-NEXT:          <key>file</key><integer>0</integer>
474 // CHECK-NEXT:         </dict>
475 // CHECK-NEXT:        </array>
476 // CHECK-NEXT:      </array>
477 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
478 // CHECK-NEXT:      <key>extended_message</key>
479 // CHECK-NEXT:      <string>Assuming &apos;p&apos; is null</string>
480 // CHECK-NEXT:      <key>message</key>
481 // CHECK-NEXT:      <string>Assuming &apos;p&apos; is null</string>
482 // CHECK-NEXT:     </dict>
483 // CHECK-NEXT:     <dict>
484 // CHECK-NEXT:      <key>kind</key><string>control</string>
485 // CHECK-NEXT:      <key>edges</key>
486 // CHECK-NEXT:       <array>
487 // CHECK-NEXT:        <dict>
488 // CHECK-NEXT:         <key>start</key>
489 // CHECK-NEXT:          <array>
490 // CHECK-NEXT:           <dict>
491 // CHECK-NEXT:            <key>line</key><integer>29</integer>
492 // CHECK-NEXT:            <key>col</key><integer>7</integer>
493 // CHECK-NEXT:            <key>file</key><integer>0</integer>
494 // CHECK-NEXT:           </dict>
495 // CHECK-NEXT:           <dict>
496 // CHECK-NEXT:            <key>line</key><integer>29</integer>
497 // CHECK-NEXT:            <key>col</key><integer>7</integer>
498 // CHECK-NEXT:            <key>file</key><integer>0</integer>
499 // CHECK-NEXT:           </dict>
500 // CHECK-NEXT:          </array>
501 // CHECK-NEXT:         <key>end</key>
502 // CHECK-NEXT:          <array>
503 // CHECK-NEXT:           <dict>
504 // CHECK-NEXT:            <key>line</key><integer>30</integer>
505 // CHECK-NEXT:            <key>col</key><integer>5</integer>
506 // CHECK-NEXT:            <key>file</key><integer>0</integer>
507 // CHECK-NEXT:           </dict>
508 // CHECK-NEXT:           <dict>
509 // CHECK-NEXT:            <key>line</key><integer>30</integer>
510 // CHECK-NEXT:            <key>col</key><integer>5</integer>
511 // CHECK-NEXT:            <key>file</key><integer>0</integer>
512 // CHECK-NEXT:           </dict>
513 // CHECK-NEXT:          </array>
514 // CHECK-NEXT:        </dict>
515 // CHECK-NEXT:       </array>
516 // CHECK-NEXT:     </dict>
517 // CHECK-NEXT:     <dict>
518 // CHECK-NEXT:      <key>kind</key><string>event</string>
519 // CHECK-NEXT:      <key>location</key>
520 // CHECK-NEXT:      <dict>
521 // CHECK-NEXT:       <key>line</key><integer>30</integer>
522 // CHECK-NEXT:       <key>col</key><integer>5</integer>
523 // CHECK-NEXT:       <key>file</key><integer>0</integer>
524 // CHECK-NEXT:      </dict>
525 // CHECK-NEXT:      <key>ranges</key>
526 // CHECK-NEXT:      <array>
527 // CHECK-NEXT:        <array>
528 // CHECK-NEXT:         <dict>
529 // CHECK-NEXT:          <key>line</key><integer>30</integer>
530 // CHECK-NEXT:          <key>col</key><integer>5</integer>
531 // CHECK-NEXT:          <key>file</key><integer>0</integer>
532 // CHECK-NEXT:         </dict>
533 // CHECK-NEXT:         <dict>
534 // CHECK-NEXT:          <key>line</key><integer>30</integer>
535 // CHECK-NEXT:          <key>col</key><integer>5</integer>
536 // CHECK-NEXT:          <key>file</key><integer>0</integer>
537 // CHECK-NEXT:         </dict>
538 // CHECK-NEXT:        </array>
539 // CHECK-NEXT:      </array>
540 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
541 // CHECK-NEXT:      <key>extended_message</key>
542 // CHECK-NEXT:      <string>Called C++ object pointer is null</string>
543 // CHECK-NEXT:      <key>message</key>
544 // CHECK-NEXT:      <string>Called C++ object pointer is null</string>
545 // CHECK-NEXT:     </dict>
546 // CHECK-NEXT:    </array>
547 // CHECK-NEXT:    <key>description</key><string>Called C++ object pointer is null</string>
548 // CHECK-NEXT:    <key>category</key><string>Logic error</string>
549 // CHECK-NEXT:    <key>type</key><string>Called C++ object pointer is null</string>
550 // CHECK-NEXT:    <key>check_name</key><string>core.CallAndMessage</string>
551 // CHECK-NEXT:    <!-- This hash is experimental and going to change! -->
552 // CHECK-NEXT:    <key>issue_hash_content_of_line_in_context</key><string>c5bd8e35fb6da070914016804720ae4d</string>
553 // CHECK-NEXT:   <key>issue_context_kind</key><string>function</string>
554 // CHECK-NEXT:   <key>issue_context</key><string>test_ic_null</string>
555 // CHECK-NEXT:   <key>issue_hash_function_offset</key><string>2</string>
556 // CHECK-NEXT:   <key>location</key>
557 // CHECK-NEXT:   <dict>
558 // CHECK-NEXT:    <key>line</key><integer>30</integer>
559 // CHECK-NEXT:    <key>col</key><integer>5</integer>
560 // CHECK-NEXT:    <key>file</key><integer>0</integer>
561 // CHECK-NEXT:   </dict>
562 // CHECK-NEXT:   </dict>
563 // CHECK-NEXT:   <dict>
564 // CHECK-NEXT:    <key>path</key>
565 // CHECK-NEXT:    <array>
566 // CHECK-NEXT:     <dict>
567 // CHECK-NEXT:      <key>kind</key><string>event</string>
568 // CHECK-NEXT:      <key>location</key>
569 // CHECK-NEXT:      <dict>
570 // CHECK-NEXT:       <key>line</key><integer>34</integer>
571 // CHECK-NEXT:       <key>col</key><integer>3</integer>
572 // CHECK-NEXT:       <key>file</key><integer>0</integer>
573 // CHECK-NEXT:      </dict>
574 // CHECK-NEXT:      <key>ranges</key>
575 // CHECK-NEXT:      <array>
576 // CHECK-NEXT:        <array>
577 // CHECK-NEXT:         <dict>
578 // CHECK-NEXT:          <key>line</key><integer>34</integer>
579 // CHECK-NEXT:          <key>col</key><integer>3</integer>
580 // CHECK-NEXT:          <key>file</key><integer>0</integer>
581 // CHECK-NEXT:         </dict>
582 // CHECK-NEXT:         <dict>
583 // CHECK-NEXT:          <key>line</key><integer>34</integer>
584 // CHECK-NEXT:          <key>col</key><integer>21</integer>
585 // CHECK-NEXT:          <key>file</key><integer>0</integer>
586 // CHECK-NEXT:         </dict>
587 // CHECK-NEXT:        </array>
588 // CHECK-NEXT:      </array>
589 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
590 // CHECK-NEXT:      <key>extended_message</key>
591 // CHECK-NEXT:      <string>&apos;p&apos; initialized to a null pointer value</string>
592 // CHECK-NEXT:      <key>message</key>
593 // CHECK-NEXT:      <string>&apos;p&apos; initialized to a null pointer value</string>
594 // CHECK-NEXT:     </dict>
595 // CHECK-NEXT:     <dict>
596 // CHECK-NEXT:      <key>kind</key><string>control</string>
597 // CHECK-NEXT:      <key>edges</key>
598 // CHECK-NEXT:       <array>
599 // CHECK-NEXT:        <dict>
600 // CHECK-NEXT:         <key>start</key>
601 // CHECK-NEXT:          <array>
602 // CHECK-NEXT:           <dict>
603 // CHECK-NEXT:            <key>line</key><integer>34</integer>
604 // CHECK-NEXT:            <key>col</key><integer>3</integer>
605 // CHECK-NEXT:            <key>file</key><integer>0</integer>
606 // CHECK-NEXT:           </dict>
607 // CHECK-NEXT:           <dict>
608 // CHECK-NEXT:            <key>line</key><integer>34</integer>
609 // CHECK-NEXT:            <key>col</key><integer>18</integer>
610 // CHECK-NEXT:            <key>file</key><integer>0</integer>
611 // CHECK-NEXT:           </dict>
612 // CHECK-NEXT:          </array>
613 // CHECK-NEXT:         <key>end</key>
614 // CHECK-NEXT:          <array>
615 // CHECK-NEXT:           <dict>
616 // CHECK-NEXT:            <key>line</key><integer>37</integer>
617 // CHECK-NEXT:            <key>col</key><integer>3</integer>
618 // CHECK-NEXT:            <key>file</key><integer>0</integer>
619 // CHECK-NEXT:           </dict>
620 // CHECK-NEXT:           <dict>
621 // CHECK-NEXT:            <key>line</key><integer>37</integer>
622 // CHECK-NEXT:            <key>col</key><integer>3</integer>
623 // CHECK-NEXT:            <key>file</key><integer>0</integer>
624 // CHECK-NEXT:           </dict>
625 // CHECK-NEXT:          </array>
626 // CHECK-NEXT:        </dict>
627 // CHECK-NEXT:       </array>
628 // CHECK-NEXT:     </dict>
629 // CHECK-NEXT:     <dict>
630 // CHECK-NEXT:      <key>kind</key><string>event</string>
631 // CHECK-NEXT:      <key>location</key>
632 // CHECK-NEXT:      <dict>
633 // CHECK-NEXT:       <key>line</key><integer>37</integer>
634 // CHECK-NEXT:       <key>col</key><integer>3</integer>
635 // CHECK-NEXT:       <key>file</key><integer>0</integer>
636 // CHECK-NEXT:      </dict>
637 // CHECK-NEXT:      <key>ranges</key>
638 // CHECK-NEXT:      <array>
639 // CHECK-NEXT:        <array>
640 // CHECK-NEXT:         <dict>
641 // CHECK-NEXT:          <key>line</key><integer>37</integer>
642 // CHECK-NEXT:          <key>col</key><integer>4</integer>
643 // CHECK-NEXT:          <key>file</key><integer>0</integer>
644 // CHECK-NEXT:         </dict>
645 // CHECK-NEXT:         <dict>
646 // CHECK-NEXT:          <key>line</key><integer>37</integer>
647 // CHECK-NEXT:          <key>col</key><integer>4</integer>
648 // CHECK-NEXT:          <key>file</key><integer>0</integer>
649 // CHECK-NEXT:         </dict>
650 // CHECK-NEXT:        </array>
651 // CHECK-NEXT:      </array>
652 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
653 // CHECK-NEXT:      <key>extended_message</key>
654 // CHECK-NEXT:      <string>Called C++ object pointer is null</string>
655 // CHECK-NEXT:      <key>message</key>
656 // CHECK-NEXT:      <string>Called C++ object pointer is null</string>
657 // CHECK-NEXT:     </dict>
658 // CHECK-NEXT:    </array>
659 // CHECK-NEXT:    <key>description</key><string>Called C++ object pointer is null</string>
660 // CHECK-NEXT:    <key>category</key><string>Logic error</string>
661 // CHECK-NEXT:    <key>type</key><string>Called C++ object pointer is null</string>
662 // CHECK-NEXT:    <key>check_name</key><string>core.CallAndMessage</string>
663 // CHECK-NEXT:    <!-- This hash is experimental and going to change! -->
664 // CHECK-NEXT:    <key>issue_hash_content_of_line_in_context</key><string>4681ee922f6860377317b26b3a4bb5d4</string>
665 // CHECK-NEXT:   <key>issue_context_kind</key><string>function</string>
666 // CHECK-NEXT:   <key>issue_context</key><string>test_ic_member_ptr</string>
667 // CHECK-NEXT:   <key>issue_hash_function_offset</key><string>4</string>
668 // CHECK-NEXT:   <key>location</key>
669 // CHECK-NEXT:   <dict>
670 // CHECK-NEXT:    <key>line</key><integer>37</integer>
671 // CHECK-NEXT:    <key>col</key><integer>3</integer>
672 // CHECK-NEXT:    <key>file</key><integer>0</integer>
673 // CHECK-NEXT:   </dict>
674 // CHECK-NEXT:   </dict>
675 // CHECK-NEXT:   <dict>
676 // CHECK-NEXT:    <key>path</key>
677 // CHECK-NEXT:    <array>
678 // CHECK-NEXT:     <dict>
679 // CHECK-NEXT:      <key>kind</key><string>control</string>
680 // CHECK-NEXT:      <key>edges</key>
681 // CHECK-NEXT:       <array>
682 // CHECK-NEXT:        <dict>
683 // CHECK-NEXT:         <key>start</key>
684 // CHECK-NEXT:          <array>
685 // CHECK-NEXT:           <dict>
686 // CHECK-NEXT:            <key>line</key><integer>41</integer>
687 // CHECK-NEXT:            <key>col</key><integer>3</integer>
688 // CHECK-NEXT:            <key>file</key><integer>0</integer>
689 // CHECK-NEXT:           </dict>
690 // CHECK-NEXT:           <dict>
691 // CHECK-NEXT:            <key>line</key><integer>41</integer>
692 // CHECK-NEXT:            <key>col</key><integer>4</integer>
693 // CHECK-NEXT:            <key>file</key><integer>0</integer>
694 // CHECK-NEXT:           </dict>
695 // CHECK-NEXT:          </array>
696 // CHECK-NEXT:         <key>end</key>
697 // CHECK-NEXT:          <array>
698 // CHECK-NEXT:           <dict>
699 // CHECK-NEXT:            <key>line</key><integer>41</integer>
700 // CHECK-NEXT:            <key>col</key><integer>7</integer>
701 // CHECK-NEXT:            <key>file</key><integer>0</integer>
702 // CHECK-NEXT:           </dict>
703 // CHECK-NEXT:           <dict>
704 // CHECK-NEXT:            <key>line</key><integer>41</integer>
705 // CHECK-NEXT:            <key>col</key><integer>7</integer>
706 // CHECK-NEXT:            <key>file</key><integer>0</integer>
707 // CHECK-NEXT:           </dict>
708 // CHECK-NEXT:          </array>
709 // CHECK-NEXT:        </dict>
710 // CHECK-NEXT:       </array>
711 // CHECK-NEXT:     </dict>
712 // CHECK-NEXT:     <dict>
713 // CHECK-NEXT:      <key>kind</key><string>event</string>
714 // CHECK-NEXT:      <key>location</key>
715 // CHECK-NEXT:      <dict>
716 // CHECK-NEXT:       <key>line</key><integer>41</integer>
717 // CHECK-NEXT:       <key>col</key><integer>7</integer>
718 // CHECK-NEXT:       <key>file</key><integer>0</integer>
719 // CHECK-NEXT:      </dict>
720 // CHECK-NEXT:      <key>ranges</key>
721 // CHECK-NEXT:      <array>
722 // CHECK-NEXT:        <array>
723 // CHECK-NEXT:         <dict>
724 // CHECK-NEXT:          <key>line</key><integer>41</integer>
725 // CHECK-NEXT:          <key>col</key><integer>7</integer>
726 // CHECK-NEXT:          <key>file</key><integer>0</integer>
727 // CHECK-NEXT:         </dict>
728 // CHECK-NEXT:         <dict>
729 // CHECK-NEXT:          <key>line</key><integer>41</integer>
730 // CHECK-NEXT:          <key>col</key><integer>8</integer>
731 // CHECK-NEXT:          <key>file</key><integer>0</integer>
732 // CHECK-NEXT:         </dict>
733 // CHECK-NEXT:        </array>
734 // CHECK-NEXT:      </array>
735 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
736 // CHECK-NEXT:      <key>extended_message</key>
737 // CHECK-NEXT:      <string>Assuming &apos;p&apos; is null</string>
738 // CHECK-NEXT:      <key>message</key>
739 // CHECK-NEXT:      <string>Assuming &apos;p&apos; is null</string>
740 // CHECK-NEXT:     </dict>
741 // CHECK-NEXT:     <dict>
742 // CHECK-NEXT:      <key>kind</key><string>control</string>
743 // CHECK-NEXT:      <key>edges</key>
744 // CHECK-NEXT:       <array>
745 // CHECK-NEXT:        <dict>
746 // CHECK-NEXT:         <key>start</key>
747 // CHECK-NEXT:          <array>
748 // CHECK-NEXT:           <dict>
749 // CHECK-NEXT:            <key>line</key><integer>41</integer>
750 // CHECK-NEXT:            <key>col</key><integer>7</integer>
751 // CHECK-NEXT:            <key>file</key><integer>0</integer>
752 // CHECK-NEXT:           </dict>
753 // CHECK-NEXT:           <dict>
754 // CHECK-NEXT:            <key>line</key><integer>41</integer>
755 // CHECK-NEXT:            <key>col</key><integer>7</integer>
756 // CHECK-NEXT:            <key>file</key><integer>0</integer>
757 // CHECK-NEXT:           </dict>
758 // CHECK-NEXT:          </array>
759 // CHECK-NEXT:         <key>end</key>
760 // CHECK-NEXT:          <array>
761 // CHECK-NEXT:           <dict>
762 // CHECK-NEXT:            <key>line</key><integer>42</integer>
763 // CHECK-NEXT:            <key>col</key><integer>5</integer>
764 // CHECK-NEXT:            <key>file</key><integer>0</integer>
765 // CHECK-NEXT:           </dict>
766 // CHECK-NEXT:           <dict>
767 // CHECK-NEXT:            <key>line</key><integer>42</integer>
768 // CHECK-NEXT:            <key>col</key><integer>14</integer>
769 // CHECK-NEXT:            <key>file</key><integer>0</integer>
770 // CHECK-NEXT:           </dict>
771 // CHECK-NEXT:          </array>
772 // CHECK-NEXT:        </dict>
773 // CHECK-NEXT:       </array>
774 // CHECK-NEXT:     </dict>
775 // CHECK-NEXT:     <dict>
776 // CHECK-NEXT:      <key>kind</key><string>event</string>
777 // CHECK-NEXT:      <key>location</key>
778 // CHECK-NEXT:      <dict>
779 // CHECK-NEXT:       <key>line</key><integer>42</integer>
780 // CHECK-NEXT:       <key>col</key><integer>5</integer>
781 // CHECK-NEXT:       <key>file</key><integer>0</integer>
782 // CHECK-NEXT:      </dict>
783 // CHECK-NEXT:      <key>ranges</key>
784 // CHECK-NEXT:      <array>
785 // CHECK-NEXT:        <array>
786 // CHECK-NEXT:         <dict>
787 // CHECK-NEXT:          <key>line</key><integer>42</integer>
788 // CHECK-NEXT:          <key>col</key><integer>5</integer>
789 // CHECK-NEXT:          <key>file</key><integer>0</integer>
790 // CHECK-NEXT:         </dict>
791 // CHECK-NEXT:         <dict>
792 // CHECK-NEXT:          <key>line</key><integer>42</integer>
793 // CHECK-NEXT:          <key>col</key><integer>37</integer>
794 // CHECK-NEXT:          <key>file</key><integer>0</integer>
795 // CHECK-NEXT:         </dict>
796 // CHECK-NEXT:        </array>
797 // CHECK-NEXT:      </array>
798 // CHECK-NEXT:      <key>depth</key><integer>0</integer>
799 // CHECK-NEXT:      <key>extended_message</key>
800 // CHECK-NEXT:      <string>Called C++ object pointer is null</string>
801 // CHECK-NEXT:      <key>message</key>
802 // CHECK-NEXT:      <string>Called C++ object pointer is null</string>
803 // CHECK-NEXT:     </dict>
804 // CHECK-NEXT:    </array>
805 // CHECK-NEXT:    <key>description</key><string>Called C++ object pointer is null</string>
806 // CHECK-NEXT:    <key>category</key><string>Logic error</string>
807 // CHECK-NEXT:    <key>type</key><string>Called C++ object pointer is null</string>
808 // CHECK-NEXT:    <key>check_name</key><string>core.CallAndMessage</string>
809 // CHECK-NEXT:    <!-- This hash is experimental and going to change! -->
810 // CHECK-NEXT:    <key>issue_hash_content_of_line_in_context</key><string>e23397f9f2eff1b08593c2b2db137494</string>
811 // CHECK-NEXT:   <key>issue_context_kind</key><string>function</string>
812 // CHECK-NEXT:   <key>issue_context</key><string>test_cast</string>
813 // CHECK-NEXT:   <key>issue_hash_function_offset</key><string>2</string>
814 // CHECK-NEXT:   <key>location</key>
815 // CHECK-NEXT:   <dict>
816 // CHECK-NEXT:    <key>line</key><integer>42</integer>
817 // CHECK-NEXT:    <key>col</key><integer>5</integer>
818 // CHECK-NEXT:    <key>file</key><integer>0</integer>
819 // CHECK-NEXT:   </dict>
820 // CHECK-NEXT:   </dict>
821 // CHECK-NEXT:  </array>
822