Skip to content

Commit d293845

Browse files
Merge pull request #18723 from aschwaighofer/fix_coro_alloca_free
IRGen: Call coro.alloca.free on the token not the address of a coro.alloca.alloc
2 parents cbd53a0 + f2ec959 commit d293845

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/IRGen/GenOpaque.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,9 @@ void IRGenFunction::emitDeallocateDynamicAlloca(StackAddress address) {
482482
if (isCoroutine()) {
483483
auto allocToken = address.getExtraInfo();
484484
assert(allocToken && "dynamic alloca in coroutine without alloc token?");
485-
(void)allocToken;
486485
auto freeFn = llvm::Intrinsic::getDeclaration(
487486
&IGM.Module, llvm::Intrinsic::ID::coro_alloca_free);
488-
Builder.CreateCall(freeFn, address.getAddressPointer());
487+
Builder.CreateCall(freeFn, allocToken);
489488
return;
490489
}
491490

0 commit comments

Comments
 (0)