[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_resume and a C-function as the main coroutine function problem
- From: Florian Weimer <fw@...>
- Date: Wed, 14 Apr 2010 12:11:10 +0200
* Tony Finch:
> You can manipulate the stack pointer in C without mucking around inside
> the guts of a jmp_buf using alloca() or C99 variable size arrays. There
> are some toy example coroutine implementations using this idea at
> http://dotat.at/cgi/git?p=picoro.git;a=heads
It's still undefied behavior. You are not allowed to call longjmp() on
jmp_buf if the function calling setjmp() has exited by any means
(including calling setjmp() in turn). It will work on many, many
architectures, but it's not a C program as such.