]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Use NULL_STK_ID consistently throughout whole Valgrind.
authorIvo Raisr <ivosh@ivosh.net>
Mon, 28 Nov 2016 21:41:28 +0000 (21:41 +0000)
committerIvo Raisr <ivosh@ivosh.net>
Mon, 28 Nov 2016 21:41:28 +0000 (21:41 +0000)
Follow up to SVN r16159, BZ#373046.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16160

coregrind/m_clientstate.c
coregrind/m_syswrap/syswrap-solaris.c

index 296d6584a438216d3b9e58a4715ab4009d6a1e3c..5962cc4aaed3fc0d1e03e2334c4eee454c5d5a81 100644 (file)
@@ -31,6 +31,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_threadstate.h"
 #include "pub_core_vki.h"
 #include "pub_core_xarray.h"
 #include "pub_core_clientstate.h"
@@ -50,7 +51,7 @@
 Addr  VG_(clstk_start_base)  = 0;
 /* Initial highest address of the stack segment of the main thread. */
 Addr  VG_(clstk_end)   = 0;
-UWord VG_(clstk_id)    = 0;
+UWord VG_(clstk_id)    = NULL_STK_ID;
 /* Maximum size of the main thread's client stack. */
 SizeT VG_(clstk_max_size) = 0;
 
index 674674f77a5fee92ba8034c5b0eddf0916e0ae68..9c850350fd01b23e7fadf0f75b0161ecfe73accb 100644 (file)
@@ -195,7 +195,7 @@ static void run_a_thread_NORETURN(Word tidW)
       VG_TRACK(die_mem_munmap, a, sizeof(struct vki_sc_shared));
 
    /* Deregister thread's stack. */
-   if (tst->os_state.stk_id != (UWord)-1)
+   if (tst->os_state.stk_id != NULL_STK_ID)
       VG_(deregister_stack)(tst->os_state.stk_id);
 
    /* Tell the tool this thread is exiting. */
@@ -708,14 +708,13 @@ static void set_stack(ThreadId tid, vki_stack_t *st)
       new_start = new_end + 1 - new_size;
    }
 
-   if (tst->os_state.stk_id == (UWord)-1) {
+   if (tst->os_state.stk_id == NULL_STK_ID) {
       /* This thread doesn't have a stack set yet. */
       VG_(debugLog)(2, "syswrap-solaris",
                        "Stack set to %#lx-%#lx (new) for thread %u.\n",
                        new_start, new_end, tid);
       tst->os_state.stk_id = VG_(register_stack)(new_start, new_end);
-   }
-   else {
+   } else {
       /* Change a thread stack. */
       VG_(debugLog)(2, "syswrap-solaris",
                        "Stack set to %#lx-%#lx (change) for thread %u.\n",
@@ -7037,7 +7036,7 @@ PRE(sys_lwp_create)
       later by libc by a setustack() call (the getsetcontext syscall). */
    ctst->client_stack_highest_byte = 0;
    ctst->client_stack_szB = 0;
-   vg_assert(ctst->os_state.stk_id == (UWord)(-1));
+   vg_assert(ctst->os_state.stk_id == NULL_STK_ID);
 
    /* Inform a tool that a new thread is created.  This has to be done before
       any other core->tool event is sent. */