From 3f6978a3fefc16f203afbc64697fe04af329cf2b Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Thu, 11 Jun 2009 09:11:27 +0000 Subject: Bind the mistakenly generated nonloc::SymbolVal to struct correctly. See the comments for added test case for details. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73189 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Analysis/array-struct.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/Analysis/array-struct.c') diff --git a/test/Analysis/array-struct.c b/test/Analysis/array-struct.c index c0e1d8b7e3..0ad7ae7e82 100644 --- a/test/Analysis/array-struct.c +++ b/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])); +} -- cgit v1.2.3-18-g5258