Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coroutines crash with MSVC (#522) #527

Merged
merged 4 commits into from
Sep 6, 2024
Merged

Fix coroutines crash with MSVC (#522) #527

merged 4 commits into from
Sep 6, 2024

Conversation

equeim
Copy link
Owner

@equeim equeim commented Sep 4, 2024

No description provided.

@equeim equeim force-pushed the fix-crash branch 2 times, most recently from 1d89d15 to 5a1acd7 Compare September 5, 2024 20:26
MSVC doesn't like when coroutine is destroyed inside final suspender's await_suspend().
Instead return false from it's await_ready() allowing compiler's injected code to destroy coroutine automatically.
In this case we also need to make sure that out Coroutine<> object doesn't destroy coroutine automatically since it will result in double free
(we call completion callback in final suspender's await_ready() which immediately destroys Coroutine<>).
@equeim equeim changed the title Enable ASAN in CI for Windows and macOS builds (#522) Fix coroutines crash with MSVC (#522) Sep 5, 2024
@equeim equeim merged commit 524cbe9 into master Sep 6, 2024
15 of 16 checks passed
@equeim equeim deleted the fix-crash branch September 6, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant