• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s
2 typedef struct { float b; } c;
3 void *a();
d()4 void *d() {
5   return a();
6 }
7 
no_find_last_store()8 void no_find_last_store() {
9   c *e = d(); // expected-note{{'e' initialized here}}
10 
11   (void)(e || e->b); // expected-note{{Assuming 'e' is null}}
12       // expected-note@-1{{Left side of '||' is false}}
13       // expected-note@-2{{Access to field 'b' results in a dereference of a null pointer (loaded from variable 'e')}}
14       // expected-warning@-3{{Access to field 'b' results in a dereference of a null pointer (loaded from variable 'e')}}
15 }
16