lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


* 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.