Skip to content

Commit 0f46018

Browse files
authored
Update libunwind::Registers_mips_o32::jumpto to allow for load delay
Fix #152922
1 parent 86813aa commit 0f46018

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

libunwind/src/UnwindRegistersRestore.S

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,9 +1044,10 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind18Registers_mips_o326jumptoEv)
10441044
lw $27, (4 * 27)($4)
10451045
lw $28, (4 * 28)($4)
10461046
lw $29, (4 * 29)($4)
1047-
lw $30, (4 * 30)($4)
10481047
// load new pc into ra
10491048
lw $31, (4 * 32)($4)
1049+
//allow for load delay, so that ra address is new value when jumping
1050+
lw $30, (4 * 30)($4)
10501051
// jump to ra, load a0 in the delay slot
10511052
jr $31
10521053
lw $4, (4 * 4)($4)
@@ -1082,11 +1083,13 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind21Registers_mips_newabi6jumptoEv)
10821083
ld $2, (8 * 2)($4)
10831084
ld $3, (8 * 3)($4)
10841085
// skip a0 for now
1085-
.irp i,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
1086+
.irp i,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29
10861087
ld $\i, (8 * \i)($4)
10871088
.endr
10881089
// load new pc into ra
1089-
ld $31, (8 * 32)($4)
1090+
lw $31, (4 * 32)($4)
1091+
//allow for load delay, so that ra address is new value when jumping
1092+
lw $30, (4 * 30)($4)
10901093
// jump to ra, load a0 in the delay slot
10911094
jr $31
10921095
ld $4, (8 * 4)($4)

0 commit comments

Comments
 (0)