| Nuno Lopes | afb32f7 | 2009-11-06 18:42:13 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s |
| 2 | // PR3135 | ||||
| 3 | |||||
| 4 | typedef struct { | ||||
| 5 | int *a; | ||||
| 6 | } structure; | ||||
| 7 | |||||
| 8 | int bar(structure *x); | ||||
| 9 | |||||
| 10 | int foo() | ||||
| 11 | { | ||||
| 12 | int x; | ||||
| 13 | structure y = {&x}; | ||||
| 14 | |||||
| 15 | // the call to bar may initialize x | ||||
| 16 | if (bar(&y) && x) // no-warning | ||||
| 17 | return 1; | ||||
| 18 | |||||
| 19 | return 0; | ||||
| 20 | } | ||||