diff options
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 2 | 
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index db24def216d..8082b33fd66 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -532,6 +532,8 @@ llvm::Value *CodeGenFunction::GetAddrOfBlockDecl(const BlockDeclRefExpr *E) {      V = Builder.CreateBitCast(V, PtrStructTy);      V = Builder.CreateStructGEP(V, getByRefValueLLVMField(VD),                                   VD->getNameAsString()); +    if (VD->getType()->isReferenceType()) +      V = Builder.CreateLoad(V);    } else {      const llvm::Type *Ty = CGM.getTypes().ConvertType(VD->getType());  | 

