r303714 - [coroutines] Fix leak in CGCoroutine.cpp
Gor Nishanov via cfe-commits
cfe-commits at lists.llvm.org
Tue May 23 18:54:37 PDT 2017
Author: gornishanov
Date: Tue May 23 20:54:37 2017
New Revision: 303714
URL: http://llvm.org/viewvc/llvm-project?rev=303714&view=rev
Log:
[coroutines] Fix leak in CGCoroutine.cpp
FinalBB need to be emitted even when unused to make sure it is deleted
Modified:
cfe/trunk/lib/CodeGen/CGCoroutine.cpp
Modified: cfe/trunk/lib/CodeGen/CGCoroutine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCoroutine.cpp?rev=303714&r1=303713&r2=303714&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCoroutine.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCoroutine.cpp Tue May 23 20:54:37 2017
@@ -430,6 +430,10 @@ void CodeGenFunction::EmitCoroutineBody(
CurCoro.Data->CurrentAwaitKind = AwaitKind::Final;
EmitStmt(S.getFinalSuspendStmt());
}
+ else {
+ // We don't need FinalBB. Emit it to make sure the block is deleted.
+ EmitBlock(FinalBB, /*IsFinished=*/true);
+ }
}
EmitBlock(RetBB);
More information about the cfe-commits
mailing list