diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-04-03 00:03:34 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-04-03 00:03:34 +0000 |
commit | 31b57628576a2355428fd4b57f828a3aa8423000 (patch) | |
tree | 2f1b49c646690f55f31c1b981ca1744974b41cb9 /test/Analysis | |
parent | d9b795524eb3dc035523f82f135d0a8adf15cd72 (diff) |
Fix another false positive in RegionStore involving doing loads from symbolic offsets. We still don't
properly reason about such accesses, but we shouldn't emit bogus "uninitialized value" warnings
either. Fixes <rdar://problem/11127008>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r-- | test/Analysis/misc-ps-region-store.m | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Analysis/misc-ps-region-store.m b/test/Analysis/misc-ps-region-store.m index 7268c909be..1c5b0b29dd 100644 --- a/test/Analysis/misc-ps-region-store.m +++ b/test/Analysis/misc-ps-region-store.m @@ -1325,3 +1325,19 @@ void rdar9444714() { *dst = '\0'; } +// Test handling symbolic elements with field accesses. +// <rdar://problem/11127008> +typedef struct { + unsigned value; +} RDar11127008; + +signed rdar_11127008_index(); + +static unsigned rdar_11127008(void) { + RDar11127008 values[] = {{.value = 0}, {.value = 1}}; + signed index = rdar_11127008_index(); + if (index < 0) return 0; + if (index >= 2) return 0; + return values[index].value; +} + |