From eac8caca04ed0fe9960242b3f37de7303c671042 Mon Sep 17 00:00:00 2001 From: Dave Cridland Date: Tue, 7 Nov 2023 13:31:44 +0000 Subject: [PATCH] Use overriden resume for co_await on tasklet Issue here is that if mixed-mode resumption ends up in use, then a deferred resume can "continue" after a co_await immediate resume, and then the coroutine handle used for the deferred resume is dangling. --- sigslot/tasklet.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sigslot/tasklet.h b/sigslot/tasklet.h index 254467d..969c24e 100644 --- a/sigslot/tasklet.h +++ b/sigslot/tasklet.h @@ -8,6 +8,7 @@ #include #include #include +#include namespace sigslot { template struct tasklet; @@ -103,7 +104,7 @@ namespace sigslot { void resolve() { resolved = true; - if (awaiting) awaiting.resume(); + if (awaiting) resume(awaiting); } virtual ~awaitable_base() = default;