1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-23 20:03:43 +01:00

(__sigsetjmp): Start updating jmp_buf only after sigprocmask() returned

successfully.  This avoids a failure in ia64-test-setjmp which
	was due to the fact that sigprocmask() caused a segfault (due to
	overflowing the stack) and at that point we had a partially updated
	jmp_buf.

(Logical change 1.272)
This commit is contained in:
hp.com!davidm 2004-10-13 14:08:02 +00:00
parent b62e5e37b3
commit 22ac4c078f

View file

@ -38,29 +38,27 @@ __sigsetjmp:
.prologue .prologue
.save ar.pfs, r35 .save ar.pfs, r35
alloc loc1 = ar.pfs, 2, 3, 3, 0 alloc loc1 = ar.pfs, 2, 3, 3, 0
add r16 = JB_MASK_SAVED*8, in0
add out2 = JB_MASK*8, in0 add out2 = JB_MASK*8, in0
st8 [in0] = sp, (JB_RP-JB_SP)*8 // sigjmp_buf[JB_SP] = sp
mov out0 = SIG_BLOCK
.save rp, loc0 .save rp, loc0
mov loc0 = rp mov loc0 = rp
mov out0 = SIG_BLOCK
.body .body
;; ;;
st8 [in0] = loc0, (JB_BSP-JB_RP)*8 // sigjmp_buf[JB_RP] = rp
st8 [r16] = in1 // sigjmp_buf[JB_MASK_SAVED] = savemask
cmp.ne p6, p0 = in1, r0 cmp.ne p6, p0 = in1, r0
mov out1 = r0 mov out1 = r0
mov loc2 = ar.bsp mov loc2 = ar.bsp
(p6) br.call.sptk.many rp = sigprocmask // sigjmp_buf[JB_MASK] = sigmask (p6) br.call.sptk.many rp = sigprocmask // sigjmp_buf[JB_MASK] = sigmask
;; ;;
st8 [in0] = loc2 // sigjmp_buf[JB_BSP] = bsp add r16 = JB_MASK_SAVED*8, in0
mov rp = loc0 st8 [in0] = sp, (JB_RP-JB_SP)*8 // sigjmp_buf[JB_SP] = sp
nop 0
mov r8 = 0 mov r8 = 0
;;
st8 [in0] = loc0, (JB_BSP-JB_RP)*8 // sigjmp_buf[JB_RP] = rp
st8 [r16] = in1 // sigjmp_buf[JB_MASK_SAVED] = savemask
mov rp = loc0
;;
st8 [in0] = loc2 // sigjmp_buf[JB_BSP] = bsp
mov.i ar.pfs = loc1 mov.i ar.pfs = loc1
br.ret.sptk.many rp br.ret.sptk.many rp