Skip to content

Commit

Permalink
fix(mips): store $t0 as $sp, correctly ignore all volatiles
Browse files Browse the repository at this point in the history
  • Loading branch information
SK83RJOSH committed Jan 10, 2024
1 parent 988a398 commit 3399454
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions src/unwinder/arch/mips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,12 @@ macro_rules! code {
(save_gp) => {
"
sw $zero, 0x00($sp)
sw $v0, 0x08($sp)
sw $v1, 0x0C($sp)
sw $a0, 0x10($sp)
sw $a1, 0x14($sp)
sw $a2, 0x18($sp)
sw $a3, 0x1C($sp)
sw $t0, 0x20($sp)
sw $t1, 0x24($sp)
sw $t2, 0x28($sp)
sw $t3, 0x2C($sp)
sw $t4, 0x30($sp)
sw $t5, 0x34($sp)
sw $t6, 0x38($sp)
sw $t7, 0x3C($sp)
sw $s0, 0x40($sp)
sw $s1, 0x44($sp)
sw $s2, 0x48($sp)
Expand All @@ -219,10 +213,8 @@ macro_rules! code {
sw $s5, 0x54($sp)
sw $s6, 0x58($sp)
sw $s7, 0x5C($sp)
sw $t8, 0x60($sp)
sw $t9, 0x64($sp)
sw $gp, 0x70($sp)
sw $sp, 0x74($sp)
sw $t0, 0x74($sp)
sw $fp, 0x78($sp)
sw $ra, 0x7C($sp)
"
Expand Down Expand Up @@ -265,17 +257,11 @@ macro_rules! code {
};
(restore_gp) => {
"
lw $v0, 0x08($a0)
lw $v1, 0x0C($a0)
lw $a1, 0x14($a0)
lw $a2, 0x18($a0)
lw $a3, 0x1C($a0)
lw $t0, 0x20($a0)
lw $t1, 0x24($a0)
lw $t2, 0x28($a0)
lw $t3, 0x2C($a0)
lw $t4, 0x30($a0)
lw $t5, 0x34($a0)
lw $t6, 0x38($a0)
lw $t7, 0x3C($a0)
lw $s0, 0x40($a0)
lw $s1, 0x44($a0)
lw $s2, 0x48($a0)
Expand All @@ -284,8 +270,6 @@ macro_rules! code {
lw $s5, 0x54($a0)
lw $s6, 0x58($a0)
lw $s7, 0x5C($a0)
lw $t8, 0x60($a0)
lw $t9, 0x64($a0)
lw $gp, 0x70($a0)
lw $sp, 0x74($a0)
lw $fp, 0x78($a0)
Expand Down

0 comments on commit 3399454

Please sign in to comment.