
24 Mar
2021
24 Mar
'21
10:18 a.m.
On Mär 22 2021, Sean Anderson wrote:
int test_longjmp_ret(int i) { jmp_buf env; int ret; int foo = i;
ret = setjmp(env); if (ret) return foo; foo = 0x1000; longjmp(env, i); /* We should not arrive here */ return foo;
This is undefined. When modifying a non-volatile auto variable between setjmp and longjmp, there is no requirement that the value is preserved.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."