lua-users home
lua-l archive

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


On Wed, 2005-02-16 at 04:15, David Jones wrote:
> On Feb 15, 2005, at 16:48, David Given wrote:
> 
> > On Tuesday 15 February 2005 16:18, David Jones wrote:
> > [...]
> >> In particular when longjmp is
> >> invoked it is allowed to trash any local variable declared in the
> >> function that called setjmp (the one to which we are jumping), unless
> >> that variable is declared volatile.

> 2) only call setjmp from within a wrapper function.  It doesn't have 
> any locals, so none to trash.  This is just a trick to get the compiler 
> to emit the necessary stacking and unstacking (which will happen when 
> you call the wrapper function).

I was about to post that too .. but it doesn't work,
from the man page:

" The stack context will be invalidated  if  the  function  which 
called setjmp() returns."

 

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net