The continue label in an ARC for-in loop should not involve
releasing the collection.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136949 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index a51a870..944a0bd 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -995,7 +995,6 @@
variable = EmitAutoVarAlloca(*cast<VarDecl>(SD->getSingleDecl()));
JumpDest LoopEnd = getJumpDestInCurrentScope("forcoll.end");
- JumpDest AfterBody = getJumpDestInCurrentScope("forcoll.next");
// Fast enumeration state.
QualType StateTy = getContext().getObjCFastEnumerationStateType();
@@ -1031,6 +1030,10 @@
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;