summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2020-05-12 12:40:04 +0800
committerJiaxun Yang <jiaxun.yang@flygoat.com>2020-05-14 16:31:55 +0800
commitec7269ea5c653c64fea9c1d490ca4298673ec13b (patch)
treedf494d6e09cb59431643e1833a3a37ca4803b799
parent402bfbe48940b5a653d4490b99c0a124c6fe1175 (diff)
downloaduxp-ec7269ea5c653c64fea9c1d490ca4298673ec13b.tar.gz
Bug 1394286 - mips64: fix error correction about stackpointer within function _NS_InvokeByIndex
Tag: #1542
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_mips64.S11
1 files changed, 5 insertions, 6 deletions
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_mips64.S b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_mips64.S
index eef34de7f2..d2c5595ab4 100644
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_mips64.S
+++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_mips64.S
@@ -67,10 +67,10 @@ NESTED(_NS_InvokeByIndex, FRAMESZ, ra)
jal invoke_copy_to_stack
REG_L t3, 8(sp) # get previous a0
- REG_L sp, 0(sp) # get orig sp back
+ REG_L s0, 0(sp) # get orig sp back and save away our stack pointer
- REG_L a0, A0OFF(sp) # a0 - that
- REG_L a1, A1OFF(sp) # a1 - methodIndex
+ REG_L a0, A0OFF(s0) # a0 - that
+ REG_L a1, A1OFF(s0) # a1 - methodIndex
# t1 = methodIndex * pow(2, PTRLOG)
# (use shift instead of mult)
@@ -105,13 +105,12 @@ NESTED(_NS_InvokeByIndex, FRAMESZ, ra)
l.d $f18, 40(t1)
l.d $f19, 48(t1)
- # save away our stack pointer and create
- # the stack pointer for the function
- move s0, sp
+ # create the stack pointer for the function
move sp, t3
jalr t9
+ ## restore stack pointer.
move sp, s0
RESTORE_GP64