aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-08-05 00:14:38 +0000
committerJohn McCall <rjmccall@apple.com>2011-08-05 00:14:38 +0000
commit4b302d32378b364703b212834f908762e570c29c (patch)
treebcbbdc71028ce4d5022348c87c23d866a322c9b7 /lib/CodeGen/CGObjC.cpp
parentace5e76e5c707f4a8447abc01ef540fa6d57ff95 (diff)
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
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r--lib/CodeGen/CGObjC.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index a51a8705f4..944a0bd2a2 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -995,7 +995,6 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){
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 @@ 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;