diff options
author | Jordy Rose <jediknil@belkadan.com> | 2010-06-25 23:23:04 +0000 |
---|---|---|
committer | Jordy Rose <jediknil@belkadan.com> | 2010-06-25 23:23:04 +0000 |
commit | 4d912b24b393fe6b7422e5502f3a330cbdc5c6b7 (patch) | |
tree | f69ba0da7a6bad3bff807efbb4e2b59067596424 /test/Analysis/no-outofbounds.c | |
parent | a006342c8650738c7e3547a1a0a70334608c5db6 (diff) |
When a constant size array is casted to another type, its length should be scaled as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106911 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/no-outofbounds.c')
-rw-r--r-- | test/Analysis/no-outofbounds.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Analysis/no-outofbounds.c b/test/Analysis/no-outofbounds.c index 771323b811..49ee80e8c2 100644 --- a/test/Analysis/no-outofbounds.c +++ b/test/Analysis/no-outofbounds.c @@ -12,3 +12,9 @@ void f() { short *z = (short*) &x; short s = z[0] + z[1]; // no-warning } + +void g() { + int a[2]; + char *b = (char*)a; + b[3] = 'c'; // no-warning +} |