chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.97k stars 1.22k forks source link

Clang tidy clang-analyzer-core.NullDereference in awaitable object. #1511

Open phelter opened 4 months ago

phelter commented 4 months ago

https://github.com/chriskohlhoff/asio/blob/54e3a844eb5f31d25416de9e509d9c24fa203c32/asio/include/asio/impl/awaitable.hpp#L507

The resume has no guarantee that the resumecontext is not nullptr - accessing this without checking for nullptr first.

With the awaitable this might not be a viable option since the ordering of when resume and after_suspend occur will play a role in when this occurs and the clang-tidy might not be able to rationalize that with coroutines.