possible bug in newlib-1.18.0/newlib/libc/machine/i386/setjmp.S
Fri Nov 5 14:09:00 GMT 2010
I think that I found a bug in
Namely, if longjmp is called with zero val (second argument), it causes
setjmp to return 0 rather than 1.
Probably the bug can be fixed as follows:
movl 8(ebp),edi /* get jmp_buf */
movl 12(ebp),eax /* store retval in j->eax */
+ test eax,eax
+ jnz skip
+ inc eax /* if eax = 0 then eax := 1 */
. . .
More information about the Newlib