diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-04-12 17:21:33 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-04-12 17:21:33 +0000 |
commit | 82cfc6849204b07e80f8ac71e33247f7df760032 (patch) | |
tree | 2fbbb7bb8cb6315866e930c0776313c69d0da5b1 /test/Analysis | |
parent | 318dd92ad834857ea5bb91de288c1eb56cdbec1a (diff) | |
download | clang-82cfc6849204b07e80f8ac71e33247f7df760032.tar.gz |
ArrayBoundCheckerV2: don't arbitrarily warn about indexing before the 0-index of a symbolic region. In many cases that isn't really the base offset.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r-- | test/Analysis/out-of-bounds.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Analysis/out-of-bounds.c b/test/Analysis/out-of-bounds.c index d6eca06571..8c65b478f1 100644 --- a/test/Analysis/out-of-bounds.c +++ b/test/Analysis/out-of-bounds.c @@ -146,3 +146,12 @@ void test4(int x) { if (x > 99) buf[x] = 1; } + +// Don't warn when indexing below the start of a symbolic region's whose +// base extent we don't know. +int *get_symbolic(); +void test_index_below_symboloc() { + int *buf = get_symbolic(); + buf[-1] = 0; // no-warning; +} + |