[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
diff --git a/test/Analysis/array-struct-region.c b/test/Analysis/array-struct-region.c
index d628c47..c4d9aff 100644
--- a/test/Analysis/array-struct-region.c
+++ b/test/Analysis/array-struct-region.c
@@ -253,6 +253,19 @@
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 @@
// FIXME: Should be TRUE.
clang_analyzer_eval(vals[index].a[0].x == 42); // expected-warning{{UNKNOWN}}
}
-