From dd7ef8a806b9de8d19ffe2a4461625cdcb6ce0b2 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sat, 12 Dec 2020 05:04:39 +0000 Subject: [PATCH] sh: makecontext: fix stack alignment --- arch/sh/makecontext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sh/makecontext.c b/arch/sh/makecontext.c index 76a0dfd..ac0c2b7 100644 --- a/arch/sh/makecontext.c +++ b/arch/sh/makecontext.c @@ -30,7 +30,7 @@ libucontext_makecontext(libucontext_ucontext_t *ucp, void (*func)(void), int arg int i; /* set up and align the stack */ - sp = (libucontext_greg_t *) (((uintptr_t) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size) & 0x4); + sp = (libucontext_greg_t *) (((uintptr_t) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size) & -4L); sp -= argc > 4 ? argc - 4 : 0; /* set up the context */