]> granicus.if.org Git - clang/commit
[analyzer] Fix crash when lambda captures a variable-length array.
authorDevin Coughlin <dcoughlin@apple.com>
Mon, 7 Dec 2015 23:01:53 +0000 (23:01 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Mon, 7 Dec 2015 23:01:53 +0000 (23:01 +0000)
commit23c857bf7fc48f88aa068d6c9c613455a16f2dc0
tree6bed37cf05123f50c785b249a80c44724aa501b3
parent822b0e48c5a2febb78ef9a07f01fcb8dad9fac77
[analyzer] Fix crash when lambda captures a variable-length array.

When a C++ lambda captures a variable-length array, it creates a capture
field to store the size of the array. The initialization expression for this
capture is null, which led the analyzer to crash when initializing the field.
To avoid this, use the size expression from the VLA type to determine the
initialization value.

rdar://problem/23748072

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254962 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
test/Analysis/lambdas.cpp