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

(rbs_spill_N): Fix off-by-one bug in indexing into next_func[].

(Logical change 1.51)
This commit is contained in:
mostang.com!davidm 2003-02-20 18:04:51 +00:00
parent 6af90d0df4
commit 0d89914d4e

View file

@ -46,19 +46,20 @@ rbs_spill_##n: \
alloc r18 = ar.pfs, 2, (n)-2, 2, 0;/* read ar.pfs */ \ alloc r18 = ar.pfs, 2, (n)-2, 2, 0;/* read ar.pfs */ \
/* first, calculate address of new stack: */ \ /* first, calculate address of new stack: */ \
addl r2 = @ltoff(stackmem), gp; \ addl r2 = @ltoff(stackmem), gp; \
shladd r8 = in0, 3, in1; /* r8 = &next_func[iteration] */ \ add r8 = 1, in0; \
;; \ ;; \
ld8 r2 = [r2]; /* r2 = &stackmem */ \ ld8 r2 = [r2]; /* r2 = &stackmem */ \
ld8 r8 = [r8]; /* r8 = next_func[iteration] */ \
shl r3 = in0, STACK_SIZE_SHIFT; \ shl r3 = in0, STACK_SIZE_SHIFT; \
shladd r8 = r8, 3, in1; /* r8 = &next_func[iteration+1] */ \
;; \
ld8 r8 = [r8]; /* r8 = next_func[iteration+1] */ \
add r2 = r2, r3; /* r2 = stackmem[iteration] */ \
;; \ ;; \
ld8 r9 = [r8], 8;; /* r9 = target's entry-point */ \ ld8 r9 = [r8], 8;; /* r9 = target's entry-point */ \
ld8 gp = [r8]; /* r22 = target's gp */ \ ld8 gp = [r8]; /* r22 = target's gp */ \
add r2 = r2, r3; /* r2 = stackmem[iteration] */ \
;; \
mov b6 = r9; \
addl r3 = STACK_SIZE-FRAME_SIZE, r2; /* r3 = &stackframe */ \ addl r3 = STACK_SIZE-FRAME_SIZE, r2; /* r3 = &stackframe */ \
;; \ ;; \
mov b6 = r9; \
st8 [r3] = sp; \ st8 [r3] = sp; \
.vframesp SAVED_SP_OFF+16; \ .vframesp SAVED_SP_OFF+16; \
adds sp = -16, r3; /* switch the memory stack */ \ adds sp = -16, r3; /* switch the memory stack */ \