diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-04-05 05:56:31 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-04-05 05:56:31 +0000 |
commit | 34ac1cf3cdc49e122ec2a3a5769057f54c4e66c7 (patch) | |
tree | c1c00c9b1be366c64f71f0659d453af911ede8d5 /clang/test/Analysis/misc-ps-region-store.cpp | |
parent | 00fa5968cbd2f7709da707f3a31c53e3f6c34537 (diff) | |
download | bcm5719-llvm-34ac1cf3cdc49e122ec2a3a5769057f54c4e66c7.tar.gz bcm5719-llvm-34ac1cf3cdc49e122ec2a3a5769057f54c4e66c7.zip |
Handle symbolicating a reference in an initializer expression that we don't understand.
llvm-svn: 154084
Diffstat (limited to 'clang/test/Analysis/misc-ps-region-store.cpp')
-rw-r--r-- | clang/test/Analysis/misc-ps-region-store.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Analysis/misc-ps-region-store.cpp b/clang/test/Analysis/misc-ps-region-store.cpp index e0cedcce935..8d75fb8ef35 100644 --- a/clang/test/Analysis/misc-ps-region-store.cpp +++ b/clang/test/Analysis/misc-ps-region-store.cpp @@ -568,3 +568,13 @@ struct PR11146::Entry { void PR11146::baz() { (void) &Entry::x; } + +// Test symbolicating a reference. In this example, the +// analyzer (originally) didn't know how to handle x[index - index2], +// returning an UnknownVal. The conjured symbol wasn't a location, +// and would result in a crash. +void rdar10924675(unsigned short x[], int index, int index2) { + unsigned short &y = x[index - index2]; + if (y == 0) + return; +} |