]> granicus.if.org Git - clang/commitdiff
Fix infinite loop in for ... in code generation.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 4 Sep 2008 21:54:37 +0000 (21:54 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 4 Sep 2008 21:54:37 +0000 (21:54 +0000)
 - Patch via Thomas Clement, thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55804 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjC.cpp

index af79b6610635698df8ef5172621635f60517e743..f7b8efbfe7c9b58c6df1a2894c39d44e015d6257 100644 (file)
@@ -435,7 +435,7 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S)
   llvm::BasicBlock *FetchMore = llvm::BasicBlock::Create("fetchmore");
   
   llvm::Value *IsLess = Builder.CreateICmpULT(Counter, Limit, "isless");
-  Builder.CreateCondBr(IsLess, LoopStart, FetchMore);
+  Builder.CreateCondBr(IsLess, LoopBody, FetchMore);
 
   // Fetch more elements.
   EmitBlock(FetchMore);