提交 90fa7296 编写于 作者: M Matt Caswell

Fix bug in async_fibre_makecontext for POSIX

async_fibre_makecontext was initialise the fibre first and then calling
getcontext(). It should be the other way around because the getcontext
call may overwrite some of the things we just initialised. This didn't
cause an issue on Linux and so the problem went unnoticed. On OS-X it
causes a crash.
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 7fecbf6f
......@@ -97,8 +97,8 @@ static inline int async_fibre_swapcontext(async_fibre *o, async_fibre *n, int r)
}
# define async_fibre_makecontext(c) \
(async_fibre_init(c) \
&& !getcontext(&(c)->fibre) \
(!getcontext(&(c)->fibre) \
&& async_fibre_init(c) \
&& (makecontext(&(c)->fibre, async_start_func, 0), 1))
# define async_fibre_init_dispatcher(d)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册