From: Nicholas Nethercote Date: Thu, 4 Nov 2004 19:40:59 +0000 (+0000) Subject: Make computations more understandable. X-Git-Tag: svn/VALGRIND_3_0_0~1378 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bfcadc611a3ed12a7e4e8534df5d5841581aa867;p=thirdparty%2Fvalgrind.git Make computations more understandable. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2933 --- diff --git a/coregrind/x86/state.c b/coregrind/x86/state.c index 7bcdb1fa3e..b5458b9dd7 100644 --- a/coregrind/x86/state.c +++ b/coregrind/x86/state.c @@ -509,18 +509,18 @@ void VGA_(thread_initial_stack)(ThreadId tid, UWord arg, Addr ret) Addr esp = (Addr)ARCH_STACK_PTR(VG_(threads)[tid].arch); /* push two args */ - esp -= 8; + esp -= 2 * sizeof(UWord); SET_PTHREQ_ESP(tid, esp); - VG_TRACK ( new_mem_stack, esp, 2 * 4 ); + VG_TRACK ( new_mem_stack, esp, 2 * sizeof(UWord) ); VG_TRACK ( pre_mem_write, Vg_CorePThread, tid, "new thread: stack", - esp, 2 * 4 ); + esp, 2 * sizeof(UWord) ); /* push arg and (bogus) return address */ - *(UWord*)(esp+4) = arg; - *(UWord*)(esp) = ret; + *(UWord*)(esp+sizeof(UWord)) = arg; + *(UWord*)(esp) = ret; - VG_TRACK ( post_mem_write, esp, 2 * 4 ); + VG_TRACK ( post_mem_write, esp, 2 * sizeof(UWord) ); }