From a05cc56124b4f1237f6355784de821e3290ddb44 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Fri, 30 Sep 2016 11:49:47 +0300 Subject: checkasm: arm/aarch64: Fix the amount of space reserved for stack parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Even if MAX_ARGS - 2 (for arm) or MAX_ARGS - 7 (for aarch64) parameters are passed on the stack to checkasm_checked_call, we actually only need to store MAX_ARGS - 4 (for arm) or MAX_ARGS - 8 (for aarch64) parameters on the stack when calling the tested function. Signed-off-by: Martin Storsjö --- tests/checkasm/aarch64/checkasm.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/checkasm/aarch64') diff --git a/tests/checkasm/aarch64/checkasm.S b/tests/checkasm/aarch64/checkasm.S index 9668518c9b..39e83372b7 100644 --- a/tests/checkasm/aarch64/checkasm.S +++ b/tests/checkasm/aarch64/checkasm.S @@ -52,7 +52,7 @@ endconst // max number of args used by any asm function. #define MAX_ARGS 15 -#define ARG_STACK ((8*(MAX_ARGS - 7) + 15) & ~15) +#define ARG_STACK ((8*(MAX_ARGS - 8) + 15) & ~15) function checkasm_checked_call, export=1 stp x29, x30, [sp, #-16]! @@ -81,7 +81,7 @@ function checkasm_checked_call, export=1 sub sp, sp, #ARG_STACK .equ pos, 0 // the first stacked arg is copied to x7 -.rept MAX_ARGS-7 +.rept MAX_ARGS-8 ldr x9, [x29, #16 + 8 + pos] str x9, [sp, #pos] .equ pos, pos + 8 -- cgit v1.2.3