diff --git a/lib/libc/i386/gen/signalcontext.c b/lib/libc/i386/gen/signalcontext.c index a66e2db16fc3..50c4889a0df5 100644 --- a/lib/libc/i386/gen/signalcontext.c +++ b/lib/libc/i386/gen/signalcontext.c @@ -56,7 +56,8 @@ __signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func) */ p = (register_t *)(void *)(intptr_t)ucp->uc_mcontext.mc_esp; *--p = (register_t)(intptr_t)ucp; - p -= sizeof(struct sigframe); + p = (register_t *)((u_register_t)p & ~0xF); /* Align to 16 bytes. */ + p = (register_t *)((u_register_t)p - sizeof(struct sigframe)); sfp = (struct sigframe *)p; bzero(sfp, sizeof(struct sigframe)); sfp->sf_signum = sig;