Fix Uninitialized Try exception when co_awaiting on fulfilled futures.
Summary: FutureAwaitable currently does not properly handle the case where an already fulfilled future is awaited on. In particular, await_ready() is based on the value of future_.isReady(), while await_resume() pulls the value from result_, regardless of whether or not result_ has been correctly initialized by the callback registered in await_suspend. When an already fulfilled future is awaited on, await_ready() will return true immediately, and await_suspend() will be bypassed and await_resume() called immediately, throwing an exception since result_ hasn't been initialized. Reviewed By: lewissbaker Differential Revision: D12816274 fbshipit-source-id: f5f697e433c1621f829af6f5509d08bac2229ddb
Showing
Please register or sign in to comment