sh: makecontext: fix stack alignment
parent
f9a3f65f5b
commit
dd7ef8a806
|
@ -30,7 +30,7 @@ libucontext_makecontext(libucontext_ucontext_t *ucp, void (*func)(void), int arg
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* set up and align the stack */
|
/* 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;
|
sp -= argc > 4 ? argc - 4 : 0;
|
||||||
|
|
||||||
/* set up the context */
|
/* set up the context */
|
||||||
|
|
Loading…
Reference in New Issue