[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)
commit7bdca8b24f2d0b4379f1a6424a6dab409925377b
tree4526065e288c59933ca51acb082df1dd80cad526
parentaf89de9d66d8adc881ce622d7d5ff58a86b7eb31
[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

llvm-svn: 254962
clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
clang/test/Analysis/lambdas.cpp