summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/array-struct.c
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-06-11 09:11:27 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-06-11 09:11:27 +0000
commit519a47d4bddd2db51eeba6fda12410ecc5999073 (patch)
tree44866126b4044204db31e534e2bd3d19ac0ae6ca /clang/test/Analysis/array-struct.c
parentc3a7992216d6cba88001572a6727de06ba27564b (diff)
downloadbcm5719-llvm-519a47d4bddd2db51eeba6fda12410ecc5999073.tar.gz
bcm5719-llvm-519a47d4bddd2db51eeba6fda12410ecc5999073.zip
Bind the mistakenly generated nonloc::SymbolVal to struct correctly. See the
comments for added test case for details. llvm-svn: 73189
Diffstat (limited to 'clang/test/Analysis/array-struct.c')
-rw-r--r--clang/test/Analysis/array-struct.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Analysis/array-struct.c b/clang/test/Analysis/array-struct.c
index c0e1d8b7e39..0ad7ae7e828 100644
--- a/clang/test/Analysis/array-struct.c
+++ b/clang/test/Analysis/array-struct.c
@@ -148,3 +148,13 @@ void f15() {
if (a[1]) // no-warning
1;
}
+
+struct s3 p[1];
+
+// Code from postgresql.
+// Current cast logic of region store mistakenly leaves the final result region
+// an ElementRegion of type 'char'. Then load a nonloc::SymbolVal from it and
+// assigns to 'a'.
+void f16(struct s3 *p) {
+ struct s3 a = *((struct s3*) ((char*) &p[0]));
+}
OpenPOWER on IntegriCloud