brintos

brintos / llvm-project-archived public Read only

0
0
Text · 611 B · e6162f5 Raw
16 lines · c
1// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s2typedef struct { float b; } c;3void *a(void);4void *d(void) {5  return a();6}7 8void no_find_last_store(void) {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