sh: makecontext: fix stack alignment

master
Ariadne Conill 2020-12-12 05:04:39 +00:00
parent f9a3f65f5b
commit dd7ef8a806
1 changed files with 1 additions and 1 deletions

View File

@ -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 */