Subject: problems w/setjmp/longjmp
To: None <macbsd-general@sun-lamp.cs.berkeley.edu>
From: Rod Morehead <rmore@netcom.com>
List: macbsd-general
Date: 01/11/1994 18:22:33
Well, with almost no experimentation I identified the
problem perl is having with setjmp and longjmp. Setjump
seems to be consistenly returning some very large integer
when longjump is called when it should be returning the second
argument to longjmp. 

What follows is some code which demonstrates this problem.

Can anyone get me a version of longjmp without this problem?

Rod Morehead
====cut here===
#include <setjmp.h>

 static void jumper(void);
 static jmp_buf jmpbuffer;

int 
main(void)
{
  int rc;
  if((rc=setjmp(jmpbuffer)) !=0)
    { printf("afterlongjmp: rc=%d(should be 1)\n",
	     rc);
      exit(0);}
 jumper();
 }


 static void
 jumper(void)
{
  longjmp(jmpbuffer,1);
}
    
  

------------------------------------------------------------------------------