forked from OSchip/llvm-project
[coroutines] Fix leak in CGCoroutine.cpp
FinalBB need to be emitted even when unused to make sure it is deleted llvm-svn: 303714
This commit is contained in:
parent
9f4950afd2
commit
db615dd677
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue