diff options
author | Anna Zaks <ganna@apple.com> | 2013-01-31 01:19:52 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2013-01-31 01:19:52 +0000 |
commit | 5255f27362ffbfedea889870bf8d5812dae97553 (patch) | |
tree | 30f33c0b9513d7ce99193c7f9d97423df7580e6c /test/Analysis/array-struct-region.c | |
parent | 7ba96aed23906c20c48a388ce10212e81174827c (diff) |
[analyzer] Fix a bug in region store that lead to undefined value false
positives.
The includeSuffix was only set on the first iteration through the
function, resulting in invalid regions being produced by getLazyBinding
(ex: zoomRegion.y).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174016 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/array-struct-region.c')
-rw-r--r-- | test/Analysis/array-struct-region.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/Analysis/array-struct-region.c b/test/Analysis/array-struct-region.c index d628c47cb0..c4d9aff95f 100644 --- a/test/Analysis/array-struct-region.c +++ b/test/Analysis/array-struct-region.c @@ -253,6 +253,19 @@ int testStructFieldChainsNested(int index, int anotherIndex) { return 0; } +typedef struct { + int zoomLevel; + struct point center; +} Outer; + +extern int test13116945(struct point x); +static void radar13116945(struct point centerCoordinate) { + Outer zoomRegion; + zoomRegion.zoomLevel = 0; + zoomRegion.center = centerCoordinate; + Outer r = zoomRegion; + test13116945(r.center); // no-warning +} // -------------------- // False positives @@ -289,4 +302,3 @@ void testFieldChainIsNotEnough(int index) { // FIXME: Should be TRUE. clang_analyzer_eval(vals[index].a[0].x == 42); // expected-warning{{UNKNOWN}} } - |