summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGor Nishanov <GorNishanov@gmail.com>2017-05-24 01:54:37 +0000
committerGor Nishanov <GorNishanov@gmail.com>2017-05-24 01:54:37 +0000
commitdb615dd677b65c89266e413ad14bf9377cf84e93 (patch)
tree5d1d34585091ba8514c80d10fc7c82b25c9f440d
parent9f4950afd2a78ca1bdd7c60356273402962479fa (diff)
downloadbcm5719-llvm-db615dd677b65c89266e413ad14bf9377cf84e93.tar.gz
bcm5719-llvm-db615dd677b65c89266e413ad14bf9377cf84e93.zip
[coroutines] Fix leak in CGCoroutine.cpp
FinalBB need to be emitted even when unused to make sure it is deleted llvm-svn: 303714
-rw-r--r--clang/lib/CodeGen/CGCoroutine.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCoroutine.cpp b/clang/lib/CodeGen/CGCoroutine.cpp
index b16ab72b42a..1316c76daf9 100644
--- a/clang/lib/CodeGen/CGCoroutine.cpp
+++ b/clang/lib/CodeGen/CGCoroutine.cpp
@@ -430,6 +430,10 @@ void CodeGenFunction::EmitCoroutineBody(const CoroutineBodyStmt &S) {
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);
OpenPOWER on IntegriCloud