1// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,experimental.core -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-output=plist -o %t %s 2// RUN: FileCheck --input-file %t %s 3 4void test_null_init(void) { 5 int *p = 0; 6 *p = 0xDEADBEEF; 7} 8 9void test_null_assign(void) { 10 int *p; 11 p = 0; 12 *p = 0xDEADBEEF; 13} 14 15void test_null_assign_transitive(void) { 16 int *p; 17 p = 0; 18 int *q = p; 19 *q = 0xDEADBEEF; 20} 21 22void test_null_cond(int *p) { 23 if (!p) { 24 *p = 0xDEADBEEF; 25 } 26} 27 28void test_null_cond_transitive(int *q) { 29 if (!q) { 30 int *p = q; 31 *p = 0xDEADBEEF; 32 } 33} 34 35void test_null_field(void) { 36 struct s { int *p; } x; 37 x.p = 0; 38 *(x.p) = 0xDEADBEEF; 39} 40 41// <rdar://problem/8331641> leak reports should not show paths that end with exit() (but ones that don't end with exit()) 42void panic() __attribute__((noreturn)); 43enum { kCFNumberSInt8Type = 1, kCFNumberSInt16Type = 2, kCFNumberSInt32Type = 3, kCFNumberSInt64Type = 4, kCFNumberFloat32Type = 5, kCFNumberFloat64Type = 6, kCFNumberCharType = 7, kCFNumberShortType = 8, kCFNumberIntType = 9, kCFNumberLongType = 10, kCFNumberLongLongType = 11, kCFNumberFloatType = 12, kCFNumberDoubleType = 13, kCFNumberCFIndexType = 14, kCFNumberNSIntegerType = 15, kCFNumberCGFloatType = 16, kCFNumberMaxType = 16 }; 44typedef const struct __CFAllocator * CFAllocatorRef; 45extern const CFAllocatorRef kCFAllocatorDefault; 46typedef signed long CFIndex; 47typedef CFIndex CFNumberType; 48typedef const struct __CFNumber * CFNumberRef; 49 50extern CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr); 51 52void rdar8331641(int x) { 53 signed z = 1; 54 CFNumberRef value = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &z); // expected-warning{{leak}} 55 if (x) 56 panic(); 57 (void) value; 58} 59 60// CHECK: <?xml version="1.0" encoding="UTF-8"?> 61// CHECK: <plist version="1.0"> 62// CHECK: <dict> 63// CHECK: <key>files</key> 64// CHECK: <array> 65// CHECK: </array> 66// CHECK: <key>diagnostics</key> 67// CHECK: <array> 68// CHECK: <dict> 69// CHECK: <key>path</key> 70// CHECK: <array> 71// CHECK: <dict> 72// CHECK: <key>kind</key><string>control</string> 73// CHECK: <key>edges</key> 74// CHECK: <array> 75// CHECK: <dict> 76// CHECK: <key>start</key> 77// CHECK: <array> 78// CHECK: <dict> 79// CHECK: <key>line</key><integer>5</integer> 80// CHECK: <key>col</key><integer>3</integer> 81// CHECK: <key>file</key><integer>0</integer> 82// CHECK: </dict> 83// CHECK: <dict> 84// CHECK: <key>line</key><integer>5</integer> 85// CHECK: <key>col</key><integer>3</integer> 86// CHECK: <key>file</key><integer>0</integer> 87// CHECK: </dict> 88// CHECK: </array> 89// CHECK: <key>end</key> 90// CHECK: <array> 91// CHECK: <dict> 92// CHECK: <key>line</key><integer>6</integer> 93// CHECK: <key>col</key><integer>3</integer> 94// CHECK: <key>file</key><integer>0</integer> 95// CHECK: </dict> 96// CHECK: <dict> 97// CHECK: <key>line</key><integer>6</integer> 98// CHECK: <key>col</key><integer>3</integer> 99// CHECK: <key>file</key><integer>0</integer> 100// CHECK: </dict> 101// CHECK: </array> 102// CHECK: </dict> 103// CHECK: </array> 104// CHECK: </dict> 105// CHECK: <dict> 106// CHECK: <key>kind</key><string>event</string> 107// CHECK: <key>location</key> 108// CHECK: <dict> 109// CHECK: <key>line</key><integer>6</integer> 110// CHECK: <key>col</key><integer>3</integer> 111// CHECK: <key>file</key><integer>0</integer> 112// CHECK: </dict> 113// CHECK: <key>ranges</key> 114// CHECK: <array> 115// CHECK: <array> 116// CHECK: <dict> 117// CHECK: <key>line</key><integer>6</integer> 118// CHECK: <key>col</key><integer>4</integer> 119// CHECK: <key>file</key><integer>0</integer> 120// CHECK: </dict> 121// CHECK: <dict> 122// CHECK: <key>line</key><integer>6</integer> 123// CHECK: <key>col</key><integer>4</integer> 124// CHECK: <key>file</key><integer>0</integer> 125// CHECK: </dict> 126// CHECK: </array> 127// CHECK: </array> 128// CHECK: <key>depth</key><integer>0</integer> 129// CHECK: <key>extended_message</key> 130// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string> 131// CHECK: <key>message</key> 132// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string> 133// CHECK: </dict> 134// CHECK: </array> 135// CHECK: <key>description</key><string>Dereference of null pointer (loaded from variable 'p')</string> 136// CHECK: <key>category</key><string>Logic error</string> 137// CHECK: <key>type</key><string>Dereference of null pointer</string> 138// CHECK: <key>issue_context_kind</key><string>function</string> 139// CHECK: <key>issue_context</key><string>test_null_init</string> 140// CHECK: <key>location</key> 141// CHECK: <dict> 142// CHECK: <key>line</key><integer>6</integer> 143// CHECK: <key>col</key><integer>3</integer> 144// CHECK: <key>file</key><integer>0</integer> 145// CHECK: </dict> 146// CHECK: </dict> 147// CHECK: <dict> 148// CHECK: <key>path</key> 149// CHECK: <array> 150// CHECK: <dict> 151// CHECK: <key>kind</key><string>control</string> 152// CHECK: <key>edges</key> 153// CHECK: <array> 154// CHECK: <dict> 155// CHECK: <key>start</key> 156// CHECK: <array> 157// CHECK: <dict> 158// CHECK: <key>line</key><integer>10</integer> 159// CHECK: <key>col</key><integer>3</integer> 160// CHECK: <key>file</key><integer>0</integer> 161// CHECK: </dict> 162// CHECK: <dict> 163// CHECK: <key>line</key><integer>10</integer> 164// CHECK: <key>col</key><integer>3</integer> 165// CHECK: <key>file</key><integer>0</integer> 166// CHECK: </dict> 167// CHECK: </array> 168// CHECK: <key>end</key> 169// CHECK: <array> 170// CHECK: <dict> 171// CHECK: <key>line</key><integer>12</integer> 172// CHECK: <key>col</key><integer>3</integer> 173// CHECK: <key>file</key><integer>0</integer> 174// CHECK: </dict> 175// CHECK: <dict> 176// CHECK: <key>line</key><integer>12</integer> 177// CHECK: <key>col</key><integer>3</integer> 178// CHECK: <key>file</key><integer>0</integer> 179// CHECK: </dict> 180// CHECK: </array> 181// CHECK: </dict> 182// CHECK: </array> 183// CHECK: </dict> 184// CHECK: <dict> 185// CHECK: <key>kind</key><string>event</string> 186// CHECK: <key>location</key> 187// CHECK: <dict> 188// CHECK: <key>line</key><integer>12</integer> 189// CHECK: <key>col</key><integer>3</integer> 190// CHECK: <key>file</key><integer>0</integer> 191// CHECK: </dict> 192// CHECK: <key>ranges</key> 193// CHECK: <array> 194// CHECK: <array> 195// CHECK: <dict> 196// CHECK: <key>line</key><integer>12</integer> 197// CHECK: <key>col</key><integer>4</integer> 198// CHECK: <key>file</key><integer>0</integer> 199// CHECK: </dict> 200// CHECK: <dict> 201// CHECK: <key>line</key><integer>12</integer> 202// CHECK: <key>col</key><integer>4</integer> 203// CHECK: <key>file</key><integer>0</integer> 204// CHECK: </dict> 205// CHECK: </array> 206// CHECK: </array> 207// CHECK: <key>depth</key><integer>0</integer> 208// CHECK: <key>extended_message</key> 209// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string> 210// CHECK: <key>message</key> 211// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string> 212// CHECK: </dict> 213// CHECK: </array> 214// CHECK: <key>description</key><string>Dereference of null pointer (loaded from variable 'p')</string> 215// CHECK: <key>category</key><string>Logic error</string> 216// CHECK: <key>type</key><string>Dereference of null pointer</string> 217// CHECK: <key>issue_context_kind</key><string>function</string> 218// CHECK: <key>issue_context</key><string>test_null_assign</string> 219// CHECK: <key>location</key> 220// CHECK: <dict> 221// CHECK: <key>line</key><integer>12</integer> 222// CHECK: <key>col</key><integer>3</integer> 223// CHECK: <key>file</key><integer>0</integer> 224// CHECK: </dict> 225// CHECK: </dict> 226// CHECK: <dict> 227// CHECK: <key>path</key> 228// CHECK: <array> 229// CHECK: <dict> 230// CHECK: <key>kind</key><string>control</string> 231// CHECK: <key>edges</key> 232// CHECK: <array> 233// CHECK: <dict> 234// CHECK: <key>start</key> 235// CHECK: <array> 236// CHECK: <dict> 237// CHECK: <key>line</key><integer>16</integer> 238// CHECK: <key>col</key><integer>3</integer> 239// CHECK: <key>file</key><integer>0</integer> 240// CHECK: </dict> 241// CHECK: <dict> 242// CHECK: <key>line</key><integer>16</integer> 243// CHECK: <key>col</key><integer>3</integer> 244// CHECK: <key>file</key><integer>0</integer> 245// CHECK: </dict> 246// CHECK: </array> 247// CHECK: <key>end</key> 248// CHECK: <array> 249// CHECK: <dict> 250// CHECK: <key>line</key><integer>19</integer> 251// CHECK: <key>col</key><integer>3</integer> 252// CHECK: <key>file</key><integer>0</integer> 253// CHECK: </dict> 254// CHECK: <dict> 255// CHECK: <key>line</key><integer>19</integer> 256// CHECK: <key>col</key><integer>3</integer> 257// CHECK: <key>file</key><integer>0</integer> 258// CHECK: </dict> 259// CHECK: </array> 260// CHECK: </dict> 261// CHECK: </array> 262// CHECK: </dict> 263// CHECK: <dict> 264// CHECK: <key>kind</key><string>event</string> 265// CHECK: <key>location</key> 266// CHECK: <dict> 267// CHECK: <key>line</key><integer>19</integer> 268// CHECK: <key>col</key><integer>3</integer> 269// CHECK: <key>file</key><integer>0</integer> 270// CHECK: </dict> 271// CHECK: <key>ranges</key> 272// CHECK: <array> 273// CHECK: <array> 274// CHECK: <dict> 275// CHECK: <key>line</key><integer>19</integer> 276// CHECK: <key>col</key><integer>4</integer> 277// CHECK: <key>file</key><integer>0</integer> 278// CHECK: </dict> 279// CHECK: <dict> 280// CHECK: <key>line</key><integer>19</integer> 281// CHECK: <key>col</key><integer>4</integer> 282// CHECK: <key>file</key><integer>0</integer> 283// CHECK: </dict> 284// CHECK: </array> 285// CHECK: </array> 286// CHECK: <key>depth</key><integer>0</integer> 287// CHECK: <key>extended_message</key> 288// CHECK: <string>Dereference of null pointer (loaded from variable 'q')</string> 289// CHECK: <key>message</key> 290// CHECK: <string>Dereference of null pointer (loaded from variable 'q')</string> 291// CHECK: </dict> 292// CHECK: </array> 293// CHECK: <key>description</key><string>Dereference of null pointer (loaded from variable 'q')</string> 294// CHECK: <key>category</key><string>Logic error</string> 295// CHECK: <key>type</key><string>Dereference of null pointer</string> 296// CHECK: <key>issue_context_kind</key><string>function</string> 297// CHECK: <key>issue_context</key><string>test_null_assign_transitive</string> 298// CHECK: <key>location</key> 299// CHECK: <dict> 300// CHECK: <key>line</key><integer>19</integer> 301// CHECK: <key>col</key><integer>3</integer> 302// CHECK: <key>file</key><integer>0</integer> 303// CHECK: </dict> 304// CHECK: </dict> 305// CHECK: <dict> 306// CHECK: <key>path</key> 307// CHECK: <array> 308// CHECK: <dict> 309// CHECK: <key>kind</key><string>control</string> 310// CHECK: <key>edges</key> 311// CHECK: <array> 312// CHECK: <dict> 313// CHECK: <key>start</key> 314// CHECK: <array> 315// CHECK: <dict> 316// CHECK: <key>line</key><integer>23</integer> 317// CHECK: <key>col</key><integer>3</integer> 318// CHECK: <key>file</key><integer>0</integer> 319// CHECK: </dict> 320// CHECK: <dict> 321// CHECK: <key>line</key><integer>23</integer> 322// CHECK: <key>col</key><integer>3</integer> 323// CHECK: <key>file</key><integer>0</integer> 324// CHECK: </dict> 325// CHECK: </array> 326// CHECK: <key>end</key> 327// CHECK: <array> 328// CHECK: <dict> 329// CHECK: <key>line</key><integer>23</integer> 330// CHECK: <key>col</key><integer>7</integer> 331// CHECK: <key>file</key><integer>0</integer> 332// CHECK: </dict> 333// CHECK: <dict> 334// CHECK: <key>line</key><integer>23</integer> 335// CHECK: <key>col</key><integer>8</integer> 336// CHECK: <key>file</key><integer>0</integer> 337// CHECK: </dict> 338// CHECK: </array> 339// CHECK: </dict> 340// CHECK: </array> 341// CHECK: </dict> 342// CHECK: <dict> 343// CHECK: <key>kind</key><string>event</string> 344// CHECK: <key>location</key> 345// CHECK: <dict> 346// CHECK: <key>line</key><integer>23</integer> 347// CHECK: <key>col</key><integer>7</integer> 348// CHECK: <key>file</key><integer>0</integer> 349// CHECK: </dict> 350// CHECK: <key>ranges</key> 351// CHECK: <array> 352// CHECK: <array> 353// CHECK: <dict> 354// CHECK: <key>line</key><integer>23</integer> 355// CHECK: <key>col</key><integer>7</integer> 356// CHECK: <key>file</key><integer>0</integer> 357// CHECK: </dict> 358// CHECK: <dict> 359// CHECK: <key>line</key><integer>23</integer> 360// CHECK: <key>col</key><integer>8</integer> 361// CHECK: <key>file</key><integer>0</integer> 362// CHECK: </dict> 363// CHECK: </array> 364// CHECK: </array> 365// CHECK: <key>depth</key><integer>0</integer> 366// CHECK: <key>extended_message</key> 367// CHECK: <string>Assuming 'p' is null</string> 368// CHECK: <key>message</key> 369// CHECK: <string>Assuming 'p' is null</string> 370// CHECK: </dict> 371// CHECK: <dict> 372// CHECK: <key>kind</key><string>control</string> 373// CHECK: <key>edges</key> 374// CHECK: <array> 375// CHECK: <dict> 376// CHECK: <key>start</key> 377// CHECK: <array> 378// CHECK: <dict> 379// CHECK: <key>line</key><integer>23</integer> 380// CHECK: <key>col</key><integer>7</integer> 381// CHECK: <key>file</key><integer>0</integer> 382// CHECK: </dict> 383// CHECK: <dict> 384// CHECK: <key>line</key><integer>23</integer> 385// CHECK: <key>col</key><integer>8</integer> 386// CHECK: <key>file</key><integer>0</integer> 387// CHECK: </dict> 388// CHECK: </array> 389// CHECK: <key>end</key> 390// CHECK: <array> 391// CHECK: <dict> 392// CHECK: <key>line</key><integer>24</integer> 393// CHECK: <key>col</key><integer>5</integer> 394// CHECK: <key>file</key><integer>0</integer> 395// CHECK: </dict> 396// CHECK: <dict> 397// CHECK: <key>line</key><integer>24</integer> 398// CHECK: <key>col</key><integer>5</integer> 399// CHECK: <key>file</key><integer>0</integer> 400// CHECK: </dict> 401// CHECK: </array> 402// CHECK: </dict> 403// CHECK: </array> 404// CHECK: </dict> 405// CHECK: <dict> 406// CHECK: <key>kind</key><string>event</string> 407// CHECK: <key>location</key> 408// CHECK: <dict> 409// CHECK: <key>line</key><integer>24</integer> 410// CHECK: <key>col</key><integer>5</integer> 411// CHECK: <key>file</key><integer>0</integer> 412// CHECK: </dict> 413// CHECK: <key>ranges</key> 414// CHECK: <array> 415// CHECK: <array> 416// CHECK: <dict> 417// CHECK: <key>line</key><integer>24</integer> 418// CHECK: <key>col</key><integer>6</integer> 419// CHECK: <key>file</key><integer>0</integer> 420// CHECK: </dict> 421// CHECK: <dict> 422// CHECK: <key>line</key><integer>24</integer> 423// CHECK: <key>col</key><integer>6</integer> 424// CHECK: <key>file</key><integer>0</integer> 425// CHECK: </dict> 426// CHECK: </array> 427// CHECK: </array> 428// CHECK: <key>depth</key><integer>0</integer> 429// CHECK: <key>extended_message</key> 430// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string> 431// CHECK: <key>message</key> 432// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string> 433// CHECK: </dict> 434// CHECK: </array> 435// CHECK: <key>description</key><string>Dereference of null pointer (loaded from variable 'p')</string> 436// CHECK: <key>category</key><string>Logic error</string> 437// CHECK: <key>type</key><string>Dereference of null pointer</string> 438// CHECK: <key>issue_context_kind</key><string>function</string> 439// CHECK: <key>issue_context</key><string>test_null_cond</string> 440// CHECK: <key>location</key> 441// CHECK: <dict> 442// CHECK: <key>line</key><integer>24</integer> 443// CHECK: <key>col</key><integer>5</integer> 444// CHECK: <key>file</key><integer>0</integer> 445// CHECK: </dict> 446// CHECK: </dict> 447// CHECK: <dict> 448// CHECK: <key>path</key> 449// CHECK: <array> 450// CHECK: <dict> 451// CHECK: <key>kind</key><string>control</string> 452// CHECK: <key>edges</key> 453// CHECK: <array> 454// CHECK: <dict> 455// CHECK: <key>start</key> 456// CHECK: <array> 457// CHECK: <dict> 458// CHECK: <key>line</key><integer>29</integer> 459// CHECK: <key>col</key><integer>3</integer> 460// CHECK: <key>file</key><integer>0</integer> 461// CHECK: </dict> 462// CHECK: <dict> 463// CHECK: <key>line</key><integer>29</integer> 464// CHECK: <key>col</key><integer>3</integer> 465// CHECK: <key>file</key><integer>0</integer> 466// CHECK: </dict> 467// CHECK: </array> 468// CHECK: <key>end</key> 469// CHECK: <array> 470// CHECK: <dict> 471// CHECK: <key>line</key><integer>29</integer> 472// CHECK: <key>col</key><integer>7</integer> 473// CHECK: <key>file</key><integer>0</integer> 474// CHECK: </dict> 475// CHECK: <dict> 476// CHECK: <key>line</key><integer>29</integer> 477// CHECK: <key>col</key><integer>8</integer> 478// CHECK: <key>file</key><integer>0</integer> 479// CHECK: </dict> 480// CHECK: </array> 481// CHECK: </dict> 482// CHECK: </array> 483// CHECK: </dict> 484// CHECK: <dict> 485// CHECK: <key>kind</key><string>control</string> 486// CHECK: <key>edges</key> 487// CHECK: <array> 488// CHECK: <dict> 489// CHECK: <key>start</key> 490// CHECK: <array> 491// CHECK: <dict> 492// CHECK: <key>line</key><integer>29</integer> 493// CHECK: <key>col</key><integer>7</integer> 494// CHECK: <key>file</key><integer>0</integer> 495// CHECK: </dict> 496// CHECK: <dict> 497// CHECK: <key>line</key><integer>29</integer> 498// CHECK: <key>col</key><integer>8</integer> 499// CHECK: <key>file</key><integer>0</integer> 500// CHECK: </dict> 501// CHECK: </array> 502// CHECK: <key>end</key> 503// CHECK: <array> 504// CHECK: <dict> 505// CHECK: <key>line</key><integer>30</integer> 506// CHECK: <key>col</key><integer>5</integer> 507// CHECK: <key>file</key><integer>0</integer> 508// CHECK: </dict> 509// CHECK: <dict> 510// CHECK: <key>line</key><integer>30</integer> 511// CHECK: <key>col</key><integer>5</integer> 512// CHECK: <key>file</key><integer>0</integer> 513// CHECK: </dict> 514// CHECK: </array> 515// CHECK: </dict> 516// CHECK: </array> 517// CHECK: </dict> 518// CHECK: <dict> 519// CHECK: <key>kind</key><string>control</string> 520// CHECK: <key>edges</key> 521// CHECK: <array> 522// CHECK: <dict> 523// CHECK: <key>start</key> 524// CHECK: <array> 525// CHECK: <dict> 526// CHECK: <key>line</key><integer>30</integer> 527// CHECK: <key>col</key><integer>5</integer> 528// CHECK: <key>file</key><integer>0</integer> 529// CHECK: </dict> 530// CHECK: <dict> 531// CHECK: <key>line</key><integer>30</integer> 532// CHECK: <key>col</key><integer>5</integer> 533// CHECK: <key>file</key><integer>0</integer> 534// CHECK: </dict> 535// CHECK: </array> 536// CHECK: <key>end</key> 537// CHECK: <array> 538// CHECK: <dict> 539// CHECK: <key>line</key><integer>31</integer> 540// CHECK: <key>col</key><integer>5</integer> 541// CHECK: <key>file</key><integer>0</integer> 542// CHECK: </dict> 543// CHECK: <dict> 544// CHECK: <key>line</key><integer>31</integer> 545// CHECK: <key>col</key><integer>5</integer> 546// CHECK: <key>file</key><integer>0</integer> 547// CHECK: </dict> 548// CHECK: </array> 549// CHECK: </dict> 550// CHECK: </array> 551// CHECK: </dict> 552// CHECK: <dict> 553// CHECK: <key>kind</key><string>event</string> 554// CHECK: <key>location</key> 555// CHECK: <dict> 556// CHECK: <key>line</key><integer>31</integer> 557// CHECK: <key>col</key><integer>5</integer> 558// CHECK: <key>file</key><integer>0</integer> 559// CHECK: </dict> 560// CHECK: <key>ranges</key> 561// CHECK: <array> 562// CHECK: <array> 563// CHECK: <dict> 564// CHECK: <key>line</key><integer>31</integer> 565// CHECK: <key>col</key><integer>6</integer> 566// CHECK: <key>file</key><integer>0</integer> 567// CHECK: </dict> 568// CHECK: <dict> 569// CHECK: <key>line</key><integer>31</integer> 570// CHECK: <key>col</key><integer>6</integer> 571// CHECK: <key>file</key><integer>0</integer> 572// CHECK: </dict> 573// CHECK: </array> 574// CHECK: </array> 575// CHECK: <key>depth</key><integer>0</integer> 576// CHECK: <key>extended_message</key> 577// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string> 578// CHECK: <key>message</key> 579// CHECK: <string>Dereference of null pointer (loaded from variable 'p')</string> 580// CHECK: </dict> 581// CHECK: </array> 582// CHECK: <key>description</key><string>Dereference of null pointer (loaded from variable 'p')</string> 583// CHECK: <key>category</key><string>Logic error</string> 584// CHECK: <key>type</key><string>Dereference of null pointer</string> 585// CHECK: <key>issue_context_kind</key><string>function</string> 586// CHECK: <key>issue_context</key><string>test_null_cond_transitive</string> 587// CHECK: <key>location</key> 588// CHECK: <dict> 589// CHECK: <key>line</key><integer>31</integer> 590// CHECK: <key>col</key><integer>5</integer> 591// CHECK: <key>file</key><integer>0</integer> 592// CHECK: </dict> 593// CHECK: </dict> 594// CHECK: <dict> 595// CHECK: <key>path</key> 596// CHECK: <array> 597// CHECK: <dict> 598// CHECK: <key>kind</key><string>control</string> 599// CHECK: <key>edges</key> 600// CHECK: <array> 601// CHECK: <dict> 602// CHECK: <key>start</key> 603// CHECK: <array> 604// CHECK: <dict> 605// CHECK: <key>line</key><integer>36</integer> 606// CHECK: <key>col</key><integer>3</integer> 607// CHECK: <key>file</key><integer>0</integer> 608// CHECK: </dict> 609// CHECK: <dict> 610// CHECK: <key>line</key><integer>36</integer> 611// CHECK: <key>col</key><integer>3</integer> 612// CHECK: <key>file</key><integer>0</integer> 613// CHECK: </dict> 614// CHECK: </array> 615// CHECK: <key>end</key> 616// CHECK: <array> 617// CHECK: <dict> 618// CHECK: <key>line</key><integer>36</integer> 619// CHECK: <key>col</key><integer>10</integer> 620// CHECK: <key>file</key><integer>0</integer> 621// CHECK: </dict> 622// CHECK: <dict> 623// CHECK: <key>line</key><integer>36</integer> 624// CHECK: <key>col</key><integer>10</integer> 625// CHECK: <key>file</key><integer>0</integer> 626// CHECK: </dict> 627// CHECK: </array> 628// CHECK: </dict> 629// CHECK: </array> 630// CHECK: </dict> 631// CHECK: <dict> 632// CHECK: <key>kind</key><string>control</string> 633// CHECK: <key>edges</key> 634// CHECK: <array> 635// CHECK: <dict> 636// CHECK: <key>start</key> 637// CHECK: <array> 638// CHECK: <dict> 639// CHECK: <key>line</key><integer>36</integer> 640// CHECK: <key>col</key><integer>10</integer> 641// CHECK: <key>file</key><integer>0</integer> 642// CHECK: </dict> 643// CHECK: <dict> 644// CHECK: <key>line</key><integer>36</integer> 645// CHECK: <key>col</key><integer>10</integer> 646// CHECK: <key>file</key><integer>0</integer> 647// CHECK: </dict> 648// CHECK: </array> 649// CHECK: <key>end</key> 650// CHECK: <array> 651// CHECK: <dict> 652// CHECK: <key>line</key><integer>38</integer> 653// CHECK: <key>col</key><integer>3</integer> 654// CHECK: <key>file</key><integer>0</integer> 655// CHECK: </dict> 656// CHECK: <dict> 657// CHECK: <key>line</key><integer>38</integer> 658// CHECK: <key>col</key><integer>3</integer> 659// CHECK: <key>file</key><integer>0</integer> 660// CHECK: </dict> 661// CHECK: </array> 662// CHECK: </dict> 663// CHECK: </array> 664// CHECK: </dict> 665// CHECK: <dict> 666// CHECK: <key>kind</key><string>event</string> 667// CHECK: <key>location</key> 668// CHECK: <dict> 669// CHECK: <key>line</key><integer>38</integer> 670// CHECK: <key>col</key><integer>3</integer> 671// CHECK: <key>file</key><integer>0</integer> 672// CHECK: </dict> 673// CHECK: <key>ranges</key> 674// CHECK: <array> 675// CHECK: <array> 676// CHECK: <dict> 677// CHECK: <key>line</key><integer>38</integer> 678// CHECK: <key>col</key><integer>7</integer> 679// CHECK: <key>file</key><integer>0</integer> 680// CHECK: </dict> 681// CHECK: <dict> 682// CHECK: <key>line</key><integer>38</integer> 683// CHECK: <key>col</key><integer>7</integer> 684// CHECK: <key>file</key><integer>0</integer> 685// CHECK: </dict> 686// CHECK: </array> 687// CHECK: </array> 688// CHECK: <key>depth</key><integer>0</integer> 689// CHECK: <key>extended_message</key> 690// CHECK: <string>Dereference of null pointer (loaded from field 'p')</string> 691// CHECK: <key>message</key> 692// CHECK: <string>Dereference of null pointer (loaded from field 'p')</string> 693// CHECK: </dict> 694// CHECK: </array> 695// CHECK: <key>description</key><string>Dereference of null pointer (loaded from field 'p')</string> 696// CHECK: <key>category</key><string>Logic error</string> 697// CHECK: <key>type</key><string>Dereference of null pointer</string> 698// CHECK: <key>issue_context_kind</key><string>function</string> 699// CHECK: <key>issue_context</key><string>test_null_field</string> 700// CHECK: <key>location</key> 701// CHECK: <dict> 702// CHECK: <key>line</key><integer>38</integer> 703// CHECK: <key>col</key><integer>3</integer> 704// CHECK: <key>file</key><integer>0</integer> 705// CHECK: </dict> 706// CHECK: </dict> 707// CHECK: <dict> 708// CHECK: <key>path</key> 709// CHECK: <array> 710// CHECK: <dict> 711// CHECK: <key>kind</key><string>control</string> 712// CHECK: <key>edges</key> 713// CHECK: <array> 714// CHECK: <dict> 715// CHECK: <key>start</key> 716// CHECK: <array> 717// CHECK: <dict> 718// CHECK: <key>line</key><integer>53</integer> 719// CHECK: <key>col</key><integer>3</integer> 720// CHECK: <key>file</key><integer>0</integer> 721// CHECK: </dict> 722// CHECK: <dict> 723// CHECK: <key>line</key><integer>53</integer> 724// CHECK: <key>col</key><integer>3</integer> 725// CHECK: <key>file</key><integer>0</integer> 726// CHECK: </dict> 727// CHECK: </array> 728// CHECK: <key>end</key> 729// CHECK: <array> 730// CHECK: <dict> 731// CHECK: <key>line</key><integer>54</integer> 732// CHECK: <key>col</key><integer>3</integer> 733// CHECK: <key>file</key><integer>0</integer> 734// CHECK: </dict> 735// CHECK: <dict> 736// CHECK: <key>line</key><integer>54</integer> 737// CHECK: <key>col</key><integer>3</integer> 738// CHECK: <key>file</key><integer>0</integer> 739// CHECK: </dict> 740// CHECK: </array> 741// CHECK: </dict> 742// CHECK: </array> 743// CHECK: </dict> 744// CHECK: <dict> 745// CHECK: <key>kind</key><string>control</string> 746// CHECK: <key>edges</key> 747// CHECK: <array> 748// CHECK: <dict> 749// CHECK: <key>start</key> 750// CHECK: <array> 751// CHECK: <dict> 752// CHECK: <key>line</key><integer>54</integer> 753// CHECK: <key>col</key><integer>3</integer> 754// CHECK: <key>file</key><integer>0</integer> 755// CHECK: </dict> 756// CHECK: <dict> 757// CHECK: <key>line</key><integer>54</integer> 758// CHECK: <key>col</key><integer>3</integer> 759// CHECK: <key>file</key><integer>0</integer> 760// CHECK: </dict> 761// CHECK: </array> 762// CHECK: <key>end</key> 763// CHECK: <array> 764// CHECK: <dict> 765// CHECK: <key>line</key><integer>54</integer> 766// CHECK: <key>col</key><integer>23</integer> 767// CHECK: <key>file</key><integer>0</integer> 768// CHECK: </dict> 769// CHECK: <dict> 770// CHECK: <key>line</key><integer>54</integer> 771// CHECK: <key>col</key><integer>82</integer> 772// CHECK: <key>file</key><integer>0</integer> 773// CHECK: </dict> 774// CHECK: </array> 775// CHECK: </dict> 776// CHECK: </array> 777// CHECK: </dict> 778// CHECK: <dict> 779// CHECK: <key>kind</key><string>event</string> 780// CHECK: <key>location</key> 781// CHECK: <dict> 782// CHECK: <key>line</key><integer>54</integer> 783// CHECK: <key>col</key><integer>23</integer> 784// CHECK: <key>file</key><integer>0</integer> 785// CHECK: </dict> 786// CHECK: <key>ranges</key> 787// CHECK: <array> 788// CHECK: <array> 789// CHECK: <dict> 790// CHECK: <key>line</key><integer>54</integer> 791// CHECK: <key>col</key><integer>23</integer> 792// CHECK: <key>file</key><integer>0</integer> 793// CHECK: </dict> 794// CHECK: <dict> 795// CHECK: <key>line</key><integer>54</integer> 796// CHECK: <key>col</key><integer>82</integer> 797// CHECK: <key>file</key><integer>0</integer> 798// CHECK: </dict> 799// CHECK: </array> 800// CHECK: </array> 801// CHECK: <key>depth</key><integer>0</integer> 802// CHECK: <key>extended_message</key> 803// CHECK: <string>Call to function 'CFNumberCreate' returns a Core Foundation object with a +1 retain count</string> 804// CHECK: <key>message</key> 805// CHECK: <string>Call to function 'CFNumberCreate' returns a Core Foundation object with a +1 retain count</string> 806// CHECK: </dict> 807// CHECK: <dict> 808// CHECK: <key>kind</key><string>control</string> 809// CHECK: <key>edges</key> 810// CHECK: <array> 811// CHECK: <dict> 812// CHECK: <key>start</key> 813// CHECK: <array> 814// CHECK: <dict> 815// CHECK: <key>line</key><integer>54</integer> 816// CHECK: <key>col</key><integer>23</integer> 817// CHECK: <key>file</key><integer>0</integer> 818// CHECK: </dict> 819// CHECK: <dict> 820// CHECK: <key>line</key><integer>54</integer> 821// CHECK: <key>col</key><integer>82</integer> 822// CHECK: <key>file</key><integer>0</integer> 823// CHECK: </dict> 824// CHECK: </array> 825// CHECK: <key>end</key> 826// CHECK: <array> 827// CHECK: <dict> 828// CHECK: <key>line</key><integer>55</integer> 829// CHECK: <key>col</key><integer>3</integer> 830// CHECK: <key>file</key><integer>0</integer> 831// CHECK: </dict> 832// CHECK: <dict> 833// CHECK: <key>line</key><integer>55</integer> 834// CHECK: <key>col</key><integer>3</integer> 835// CHECK: <key>file</key><integer>0</integer> 836// CHECK: </dict> 837// CHECK: </array> 838// CHECK: </dict> 839// CHECK: </array> 840// CHECK: </dict> 841// CHECK: <dict> 842// CHECK: <key>kind</key><string>control</string> 843// CHECK: <key>edges</key> 844// CHECK: <array> 845// CHECK: <dict> 846// CHECK: <key>start</key> 847// CHECK: <array> 848// CHECK: <dict> 849// CHECK: <key>line</key><integer>55</integer> 850// CHECK: <key>col</key><integer>3</integer> 851// CHECK: <key>file</key><integer>0</integer> 852// CHECK: </dict> 853// CHECK: <dict> 854// CHECK: <key>line</key><integer>55</integer> 855// CHECK: <key>col</key><integer>3</integer> 856// CHECK: <key>file</key><integer>0</integer> 857// CHECK: </dict> 858// CHECK: </array> 859// CHECK: <key>end</key> 860// CHECK: <array> 861// CHECK: <dict> 862// CHECK: <key>line</key><integer>55</integer> 863// CHECK: <key>col</key><integer>7</integer> 864// CHECK: <key>file</key><integer>0</integer> 865// CHECK: </dict> 866// CHECK: <dict> 867// CHECK: <key>line</key><integer>55</integer> 868// CHECK: <key>col</key><integer>7</integer> 869// CHECK: <key>file</key><integer>0</integer> 870// CHECK: </dict> 871// CHECK: </array> 872// CHECK: </dict> 873// CHECK: </array> 874// CHECK: </dict> 875// CHECK: <dict> 876// CHECK: <key>kind</key><string>control</string> 877// CHECK: <key>edges</key> 878// CHECK: <array> 879// CHECK: <dict> 880// CHECK: <key>start</key> 881// CHECK: <array> 882// CHECK: <dict> 883// CHECK: <key>line</key><integer>55</integer> 884// CHECK: <key>col</key><integer>7</integer> 885// CHECK: <key>file</key><integer>0</integer> 886// CHECK: </dict> 887// CHECK: <dict> 888// CHECK: <key>line</key><integer>55</integer> 889// CHECK: <key>col</key><integer>7</integer> 890// CHECK: <key>file</key><integer>0</integer> 891// CHECK: </dict> 892// CHECK: </array> 893// CHECK: <key>end</key> 894// CHECK: <array> 895// CHECK: <dict> 896// CHECK: <key>line</key><integer>57</integer> 897// CHECK: <key>col</key><integer>10</integer> 898// CHECK: <key>file</key><integer>0</integer> 899// CHECK: </dict> 900// CHECK: <dict> 901// CHECK: <key>line</key><integer>57</integer> 902// CHECK: <key>col</key><integer>10</integer> 903// CHECK: <key>file</key><integer>0</integer> 904// CHECK: </dict> 905// CHECK: </array> 906// CHECK: </dict> 907// CHECK: </array> 908// CHECK: </dict> 909// CHECK: <dict> 910// CHECK: <key>kind</key><string>control</string> 911// CHECK: <key>edges</key> 912// CHECK: <array> 913// CHECK: <dict> 914// CHECK: <key>start</key> 915// CHECK: <array> 916// CHECK: <dict> 917// CHECK: <key>line</key><integer>57</integer> 918// CHECK: <key>col</key><integer>10</integer> 919// CHECK: <key>file</key><integer>0</integer> 920// CHECK: </dict> 921// CHECK: <dict> 922// CHECK: <key>line</key><integer>57</integer> 923// CHECK: <key>col</key><integer>10</integer> 924// CHECK: <key>file</key><integer>0</integer> 925// CHECK: </dict> 926// CHECK: </array> 927// CHECK: <key>end</key> 928// CHECK: <array> 929// CHECK: <dict> 930// CHECK: <key>line</key><integer>58</integer> 931// CHECK: <key>col</key><integer>1</integer> 932// CHECK: <key>file</key><integer>0</integer> 933// CHECK: </dict> 934// CHECK: <dict> 935// CHECK: <key>line</key><integer>58</integer> 936// CHECK: <key>col</key><integer>1</integer> 937// CHECK: <key>file</key><integer>0</integer> 938// CHECK: </dict> 939// CHECK: </array> 940// CHECK: </dict> 941// CHECK: </array> 942// CHECK: </dict> 943// CHECK: <dict> 944// CHECK: <key>kind</key><string>event</string> 945// CHECK: <key>location</key> 946// CHECK: <dict> 947// CHECK: <key>line</key><integer>58</integer> 948// CHECK: <key>col</key><integer>1</integer> 949// CHECK: <key>file</key><integer>0</integer> 950// CHECK: </dict> 951// CHECK: <key>depth</key><integer>0</integer> 952// CHECK: <key>extended_message</key> 953// CHECK: <string>Object leaked: object allocated and stored into 'value' is not referenced later in this execution path and has a retain count of +1</string> 954// CHECK: <key>message</key> 955// CHECK: <string>Object leaked: object allocated and stored into 'value' is not referenced later in this execution path and has a retain count of +1</string> 956// CHECK: </dict> 957// CHECK: </array> 958// CHECK: <key>description</key><string>Potential leak of an object stored into 'value'</string> 959// CHECK: <key>category</key><string>Memory (Core Foundation/Objective-C)</string> 960// CHECK: <key>type</key><string>Leak</string> 961// CHECK: <key>issue_context_kind</key><string>function</string> 962// CHECK: <key>issue_context</key><string>rdar8331641</string> 963// CHECK: <key>location</key> 964// CHECK: <dict> 965// CHECK: <key>line</key><integer>58</integer> 966// CHECK: <key>col</key><integer>1</integer> 967// CHECK: <key>file</key><integer>0</integer> 968// CHECK: </dict> 969// CHECK: </dict> 970// CHECK: </array> 971// CHECK: </dict> 972// CHECK: </plist> 973