Skip to content

Commit 4a9ab66

Browse files
authored
Merge pull request swiftlang#34805 from DougGregor/asynchandler-trap
[Concurrency] Emit @asyncHandler bodies as traps.
2 parents 54144ac + 97c5e24 commit 4a9ab66

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/SILGen/SILGenFunction.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,14 @@ void SILGenFunction::emitFunction(FuncDecl *fd) {
517517
fd->getResultInterfaceType(), fd->hasThrows(), fd->getThrowsLoc());
518518
prepareEpilog(true, fd->hasThrows(), CleanupLocation(fd));
519519

520-
emitStmt(fd->getTypecheckedBody());
520+
if (fd->isAsyncHandler()) {
521+
// Async handlers are need to have their bodies emitted into a
522+
// detached task.
523+
// FIXME: Actually implement these properly.
524+
B.createBuiltinTrap(fd->getTypecheckedBody());
525+
} else {
526+
emitStmt(fd->getTypecheckedBody());
527+
}
521528

522529
emitEpilog(fd);
523530

0 commit comments

Comments
 (0)