aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-05-16 16:50:20 +0000
committerDouglas Gregor <dgregor@apple.com>2012-05-16 16:50:20 +0000
commit29a93f810ae5277446f610e8b6cdf0985febb989 (patch)
tree58f6311ea3dc93f8dcfbc20b750e3ce9cf9a488c /lib/CodeGen/CGBlocks.cpp
parentd0792de17387e949c27f97a5fa4a0b3e82db9b1e (diff)
Fix code generation of variables reference expressions when mixing
blocks and lambdas, based heavily on a patch from Meador Inge. Fixes PR12746 / <rdar://problem/11465120>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156925 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r--lib/CodeGen/CGBlocks.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index dad8e7ea7c..47c6c48018 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -698,7 +698,7 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const CGBlockInfo &blockInfo) {
// Compute the address of the thing we're going to move into the
// block literal.
llvm::Value *src;
- if (ci->isNested()) {
+ if (BlockInfo && ci->isNested()) {
// We need to use the capture from the enclosing block.
const CGBlockInfo::Capture &enclosingCapture =
BlockInfo->getCapture(variable);