From: SeokYeon Hwang Date: Mon, 19 Oct 2015 04:57:24 +0000 (+0900) Subject: coroutine: co->fiber has not to be null X-Git-Tag: TizenStudio_2.0_p2.3.2~215 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ef3b80ef6e5283c5b4f5c6a6f98d3b91db696ae;p=sdk%2Femulator%2Fqemu.git coroutine: co->fiber has not to be null CreateFiber() will be return NULL when it fails. If co->fiber is null, SwitchToFiber() aborts with C0000005 and it corrupts stack that make hard to find causes. So it is better to abort when CreateFiber() returns NULL. Change-Id: Ifdc36404ce523cee842fd486bdbe071e58b7d7b3 Signed-off-by: SeokYeon Hwang --- diff --git a/coroutine-win32.c b/coroutine-win32.c index 17ace37..8941e03 100644 --- a/coroutine-win32.c +++ b/coroutine-win32.c @@ -75,6 +75,9 @@ Coroutine *qemu_coroutine_new(void) co = g_malloc0(sizeof(*co)); co->fiber = CreateFiber(stack_size, coroutine_trampoline, &co->base); + + g_assert(co->fiber); + return &co->base; }