Browse Source

checkasm: aarch64: Don't clobber x29 in checkasm_stack_clobber

x29 (FP) is a callee saved register and should be restored on
return. Instead of backing up x29 and restoring it here, back up
sp in a register that we are allowed to overwrite.

This fixes crashes in checkasm on aarch64 since f1b3e13138.
For some reason, gcc builds didn't crash, but clang builds do.

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n3.3
Martin Storsjö 8 years ago
parent
commit
dd5d4a0e1e
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      tests/checkasm/aarch64/checkasm.S

+ 2
- 2
tests/checkasm/aarch64/checkasm.S View File

@@ -55,13 +55,13 @@ endconst
#define CLOBBER_STACK ((8*MAX_ARGS + 15) & ~15) #define CLOBBER_STACK ((8*MAX_ARGS + 15) & ~15)


function checkasm_stack_clobber, export=1 function checkasm_stack_clobber, export=1
mov x29, sp
mov x3, sp
mov x2, #CLOBBER_STACK mov x2, #CLOBBER_STACK
1: 1:
stp x0, x1, [sp, #-16]! stp x0, x1, [sp, #-16]!
subs x2, x2, #16 subs x2, x2, #16
b.gt 1b b.gt 1b
mov sp, x29
mov sp, x3
ret ret
endfunc endfunc




Loading…
Cancel
Save