From 2d01f78684cde8dc96de4cb9c913bccdff1ee004 Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Wed, 22 Apr 2015 14:16:11 +0000 Subject: [PATCH] Rename VG_(am_is_bogus_client_stack_pointer) to VG_(am_addr_is_in_extensible_client_stack). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15132 --- coregrind/m_aspacemgr/aspacemgr-linux.c | 22 +++++++++++----------- coregrind/m_syswrap/syswrap-main.c | 2 +- coregrind/pub_core_aspacemgr.h | 5 +++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 937c1c47d9..d1740f7b87 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -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: diff --git a/coregrind/m_syswrap/syswrap-main.c b/coregrind/m_syswrap/syswrap-main.c index c5aac59b4d..4d6d9ba769 100644 --- a/coregrind/m_syswrap/syswrap-main.c +++ b/coregrind/m_syswrap/syswrap-main.c @@ -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 diff --git a/coregrind/pub_core_aspacemgr.h b/coregrind/pub_core_aspacemgr.h index 767b878bde..6675375231 100644 --- a/coregrind/pub_core_aspacemgr.h +++ b/coregrind/pub_core_aspacemgr.h @@ -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 -- 2.47.3