diff options
author | Anna Zaks <ganna@apple.com> | 2013-06-06 00:19:36 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2013-06-06 00:19:36 +0000 |
commit | 73b417f363a67439b30b3167ef8d9fb32e37191b (patch) | |
tree | 5e33c0b30f004fb809332d32e12aeb56f77f014e /test | |
parent | 1089a57a88051f84aca66f3d8c92bda32a3a5c49 (diff) | |
download | clang-73b417f363a67439b30b3167ef8d9fb32e37191b.tar.gz |
[analyzer] Fix a crash that occurs when processing an rvalue array.
When processing ArrayToPointerDecay, we expect the array to be a location, not a LazyCompoundVal.
Special case the rvalue arrays by using a location to represent them. This case is handled similarly
elsewhere in the code.
Fixes PR16206.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaTemplate/array-to-pointer-decay.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaTemplate/array-to-pointer-decay.cpp b/test/SemaTemplate/array-to-pointer-decay.cpp index 26d277d7dc..dcf0901610 100644 --- a/test/SemaTemplate/array-to-pointer-decay.cpp +++ b/test/SemaTemplate/array-to-pointer-decay.cpp @@ -24,3 +24,15 @@ template <typename Type> static bool sanitize() { return !c->start; } bool closure = sanitize<int>(); + +// PR16206 +typedef struct { + char x[4]; +} chars; + +chars getChars(); +void use(char *); + +void test() { + use(getChars().x); +} |