]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Rename VG_(am_is_bogus_client_stack_pointer) to
authorFlorian Krohm <florian@eich-krohm.de>
Wed, 22 Apr 2015 14:16:11 +0000 (14:16 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Wed, 22 Apr 2015 14:16:11 +0000 (14:16 +0000)
VG_(am_addr_is_in_extensible_client_stack).

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

coregrind/m_aspacemgr/aspacemgr-linux.c
coregrind/m_syswrap/syswrap-main.c
coregrind/pub_core_aspacemgr.h

index 937c1c47d9fd412e693d945a44bd216519684c86..d1740f7b872c56d6a1da4c53eb4c852d534a51db 100644 (file)
@@ -1282,12 +1282,12 @@ static Bool any_Ts_in_range ( Addr start, SizeT len )
 }
 
 
-/* Check whether ADDR looks like a bogus stack pointer. Non-bogosity is
-   defined as follows: ADDR is not bogus if
-   (1) it points into an already mapped stack segment, OR
-   (2) it points into a reservation segment into which an abutting SkAnonC
+/* Check whether ADDR looks like an address or address-to-be located in an
+   extensible client stack segment. Return true if 
+   (1) ADDR is located in an already mapped stack segment, OR
+   (2) ADDR is located in a reservation segment into which an abutting SkAnonC
        segment can be extended. */
-Bool VG_(am_is_bogus_client_stack_pointer)( Addr addr )
+Bool VG_(am_addr_is_in_extensible_client_stack)( Addr addr )
 {
    const NSegment *seg = nsegments + find_nsegment_idx(addr);
 
@@ -1297,17 +1297,17 @@ Bool VG_(am_is_bogus_client_stack_pointer)( Addr addr )
    case SkFileV:
    case SkFileC:
    case SkShmC:
-      return True;
+      return False;
 
    case SkResvn: {
-      if (seg->smode != SmUpper) return True;
+      if (seg->smode != SmUpper) return False;
       /* If the the abutting segment towards higher addresses is an SkAnonC
          segment, then ADDR is a future stack pointer. */
       const NSegment *next = VG_(am_next_nsegment)(seg, /*forward*/ True);
-      if (next == NULL || next->kind != SkAnonC) return True;
+      if (next == NULL || next->kind != SkAnonC) return False;
 
       /* OK; looks like a stack segment */
-      return False;
+      return True;
    }
 
    case SkAnonC: {
@@ -1315,10 +1315,10 @@ Bool VG_(am_is_bogus_client_stack_pointer)( Addr addr )
          segment, then ADDR is a stack pointer into mapped memory. */
       const NSegment *next = VG_(am_next_nsegment)(seg, /*forward*/ False);
       if (next == NULL || next->kind != SkResvn || next->smode != SmUpper)
-         return True;
+         return False;
 
       /* OK; looks like a stack segment */
-      return False;
+      return True;
    }
 
    default:
index c5aac59b4d93c7dda1019b6ec42e05fb9925e084..4d6d9ba769249a3afce803b497742e90110257b6 100644 (file)
@@ -1550,7 +1550,7 @@ void VG_(client_syscall) ( ThreadId tid, UInt trc )
 
          So the approximation we're taking here is to extend the stack only
          if the client stack pointer does not look bogus. */
-      if (! VG_(am_is_bogus_client_stack_pointer)(stackMin))
+      if (VG_(am_addr_is_in_extensible_client_stack)(stackMin))
          VG_(extend_stack)( tid, stackMin );
    }
 #  endif
index 767b878bdec4bd2c3aa73719a5fe0d6a18855e0e..667537523138fa9b6c54f2f3806b4db03385e30b 100644 (file)
@@ -91,8 +91,9 @@ extern Bool VG_(am_is_valid_for_valgrind)
 extern Bool VG_(am_is_valid_for_client_or_free_or_resvn)
    ( Addr start, SizeT len, UInt prot );
 
-/* Check whether ADDR looks like a bogus stack pointer. */
-extern Bool VG_(am_is_bogus_client_stack_pointer)( Addr addr );
+/* Check whether ADDR looks like an address or address-to-be located in an
+   extensible client stack segment. */
+extern Bool VG_(am_addr_is_in_extensible_client_stack)( Addr addr );
 
 /* Trivial fn: return the total amount of space in anonymous mappings,
    both for V and the client.  Is used for printing stats in