2018-09-25 05:20:30 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s
|
|
|
|
typedef struct { float b; } c;
|
|
|
|
void *a();
|
|
|
|
void *d() {
|
2019-08-14 07:22:33 +08:00
|
|
|
return a();
|
2018-09-25 05:20:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void no_find_last_store() {
|
2019-08-14 07:22:33 +08:00
|
|
|
c *e = d(); // expected-note{{'e' initialized here}}
|
2018-09-25 05:20:30 +08:00
|
|
|
|
|
|
|
(void)(e || e->b); // expected-note{{Assuming 'e' is null}}
|
|
|
|
// expected-note@-1{{Left side of '||' is false}}
|
|
|
|
// expected-note@-2{{Access to field 'b' results in a dereference of a null pointer (loaded from variable 'e')}}
|
|
|
|
// expected-warning@-3{{Access to field 'b' results in a dereference of a null pointer (loaded from variable 'e')}}
|
|
|
|
}
|