From 28d986c628d62c3e445dd6a9dbfe90feae4882a3 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Wed, 1 Apr 2026 18:53:04 +0100 Subject: [PATCH] liblaunch: ensure stack pointers remain aligned --- lib/liblaunch/stack.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/liblaunch/stack.c b/lib/liblaunch/stack.c index 82f4de6..f701ecd 100644 --- a/lib/liblaunch/stack.c +++ b/lib/liblaunch/stack.c @@ -24,6 +24,9 @@ void *stack_writer_put_string( w->w_local_sp -= (len + 1); w->w_remote_sp -= (len + 1); + w->w_local_sp &= ~0x0F; + w->w_remote_sp &= ~0x0F; + char *local_ptr = (char *)w->w_local_sp; virt_addr_t remote_ptr = w->w_remote_sp; @@ -46,6 +49,9 @@ void *stack_writer_put( w->w_local_sp -= len; w->w_remote_sp -= len; + w->w_local_sp &= ~0x0F; + w->w_remote_sp &= ~0x0F; + void *local_ptr = (char *)w->w_local_sp; virt_addr_t remote_ptr = w->w_remote_sp;