From cfddabf5a308ad414e69d439ec230f6bfc07351d Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 9 Sep 2010 00:21:45 +0000 Subject: Block ivar layout must assume that the 'isa' field of the block descriptor is GC'able (scanned) as this what the runtime expects (one can send it messages). Radar 8394947. llvm-svn: 113454 --- clang/lib/CodeGen/CGObjCMac.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/CodeGen/CGObjCMac.cpp') diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index 9bd1d661e7d..82541356863 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -1675,6 +1675,9 @@ llvm::Constant *CGObjCCommonMac::GCBlockLayout(CodeGen::CodeGenFunction &CGF, unsigned WordSizeInBits = CGM.getContext().Target.getPointerWidth(0); unsigned ByteSizeInBits = CGM.getContext().Target.getCharWidth(); + // __isa is the first field in block descriptor and must assume by runtime's + // convention that it is GC'able. + IvarsInfo.push_back(GC_IVAR(0, 1)); for (size_t i = 0; i < DeclRefs.size(); ++i) { const BlockDeclRefExpr *BDRE = DeclRefs[i]; const ValueDecl *VD = BDRE->getDecl(); -- cgit v1.2.3