|
From: Paul F. <pa...@so...> - 2026-03-11 21:06:34
|
https://sourceware.org/cgit/valgrind/commit/?id=48d1e600f156550489c8ed11ccf236d333b8de8d commit 48d1e600f156550489c8ed11ccf236d333b8de8d Author: Paul Floyd <pj...@wa...> Date: Wed Mar 11 22:02:49 2026 +0100 Darwin initimg: fix location for start of stringtable on x86 I was calculating the remainder (%16) rather than the amount needed to round up to the next multiple of 16. That worked on amd64 where it is 0 or 8 either way. On x86 4 and 12 were the wrong way round. Diff: --- coregrind/m_initimg/initimg-darwin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/m_initimg/initimg-darwin.c b/coregrind/m_initimg/initimg-darwin.c index 5ef2269fee..b65ab4f5a9 100644 --- a/coregrind/m_initimg/initimg-darwin.c +++ b/coregrind/m_initimg/initimg-darwin.c @@ -444,7 +444,7 @@ Addr setup_client_stack( void* init_sp, rounding up stringsize to a multiple of sizeof(Word) plus rounding of the whole from a multiple of sizeof(Word) to a multiple of 16. Need to keep both of these in order to calculate stringbase. */ - size_t pointer_slop = stacksize % 16; + size_t pointer_slop = VG_ROUNDUP(stacksize, 16) - stacksize; stacksize = VG_ROUNDUP(stacksize, 16); if (0) VG_(printf)("stacksize = %u\n", stacksize); |