From 91e82dd47734ecd8a190a0e10b2283bae34319ef Mon Sep 17 00:00:00 2001 From: John McCall Date: Fri, 5 Aug 2011 00:14:38 +0000 Subject: The continue label in an ARC for-in loop should not involve releasing the collection. llvm-svn: 136949 --- clang/lib/CodeGen/CGObjC.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGObjC.cpp') diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index a51a8705f48..944a0bd2a2c 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -995,7 +995,6 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){ variable = EmitAutoVarAlloca(*cast(SD->getSingleDecl())); JumpDest LoopEnd = getJumpDestInCurrentScope("forcoll.end"); - JumpDest AfterBody = getJumpDestInCurrentScope("forcoll.next"); // Fast enumeration state. QualType StateTy = getContext().getObjCFastEnumerationStateType(); @@ -1031,6 +1030,10 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){ Collection = EmitScalarExpr(S.getCollection()); } + // The 'continue' label needs to appear within the cleanup for the + // collection object. + JumpDest AfterBody = getJumpDestInCurrentScope("forcoll.next"); + // Send it our message: CallArgList Args; -- cgit v1.2.3