From 8ef3b80ef6e5283c5b4f5c6a6f98d3b91db696ae Mon Sep 17 00:00:00 2001 From: SeokYeon Hwang Date: Mon, 19 Oct 2015 13:57:24 +0900 Subject: [PATCH] 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 --- coroutine-win32.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.7.4