aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/malloc-sizeof.c
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-09-08 00:09:02 +0000
committerAnna Zaks <ganna@apple.com>2012-09-08 00:09:02 +0000
commit9f6ec8253e3ec3e9722ca7e4599f977db2f786ef (patch)
tree07eca3e9ba3cf0062e8ff11101a0c1911fa03594 /test/Analysis/malloc-sizeof.c
parent841011373b345cf79d0da4b7242dcf2869a43502 (diff)
[analyzer] Address John's code review for r163407.
Teach malloc sizeof checker to find type inconsistencies in multi- dimensional arrays. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/malloc-sizeof.c')
-rw-r--r--test/Analysis/malloc-sizeof.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/Analysis/malloc-sizeof.c b/test/Analysis/malloc-sizeof.c
index 943c4ce17c..7a8585fa84 100644
--- a/test/Analysis/malloc-sizeof.c
+++ b/test/Analysis/malloc-sizeof.c
@@ -37,9 +37,11 @@ void ignore_const() {
int *mallocArraySize() {
static const int sTable[10];
- static const int nestedTable[10][10];
+ static const int nestedTable[10][2];
int *table = malloc(sizeof sTable);
int *table1 = malloc(sizeof nestedTable);
+ int (*table2)[2] = malloc(sizeof nestedTable);
+ int (*table3)[10][2] = malloc(sizeof nestedTable);
return table;
}