From e226534b06dc18a50deae0a1b5221984e7911137 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 23 May 2009 02:49:02 +0000 Subject: Initialize Obj-C GC attributes when emitting BlockDeclRefExprs. - Otherwise we may incorrectly miss generation of some write barriers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72313 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 0b7ad05b30..2fe6754293 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -723,7 +723,9 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { } LValue CodeGenFunction::EmitBlockDeclRefLValue(const BlockDeclRefExpr *E) { - return LValue::MakeAddr(GetAddrOfBlockDecl(E), 0); + return LValue::MakeAddr(GetAddrOfBlockDecl(E), + E->getType().getCVRQualifiers(), + getContext().getObjCGCAttrKind(E->getType())); } LValue CodeGenFunction::EmitUnaryOpLValue(const UnaryOperator *E) { -- cgit v1.2.3