[LLVMdev] built-in longjmp and setjmp

Jakob Stoklund Olesen
Wed, 13 Apr 2011 17:05:09 -0000

On Apr 13, 2011, at 9:51 AM, Akira Hatanaka wrote:

> int
> main (int argc, char** argv)
> {
>   int n = atoi(argv[1]), r;
>
>   if ((r = setjmp (buf)))
>     {
>       printf("n = %d\n", n);
>       return 0;
>     }

Non-volatile local variables are not preserved by setjmp(), so this program can
print whatever it wants.

/jakob