[M3devel] SaveRegsInStack

hendrik at topoi.pooq.com hendrik at topoi.pooq.com
Sun Nov 22 14:37:14 CET 2009


On Sun, Nov 22, 2009 at 05:02:53AM +0000, Jay K wrote:
> 
> 
> void SaveRegsInStack(void)
> 
> {
> 
> #if defined(__sparc) || defined(__ia64__)
> 
>   jmpbuf j;
> 
>   if (!setjmp(j)) longjmp(j, 1);
> 
> #endif
> 
> }

I don't know the context, so this may be OK, but what screams at me 
about this code is that upon returning from SaveRegsInStack j is popped 
from the stack, as a local variable.  I hope there is some good reason 
to presume that that piece of stack isn't overwritten by, for example, 
another call, or a Unix signal handler.

-- hendrik



More information about the M3devel mailing list