]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
No need to call VG_(am_find_nsegment) if the stack is found in the stack cache.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 23 Feb 2016 21:09:59 +0000 (21:09 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 23 Feb 2016 21:09:59 +0000 (21:09 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15807

coregrind/m_stacks.c

index aac5ebf7f0f5b35f392c6156b7ce336f60f90c8c..56a564f6f09138e5a155395975363cf97c30d6d3 100644 (file)
@@ -270,13 +270,13 @@ void VG_(change_stack)(UWord id, Addr start, Addr end)
 void VG_(stack_limits)(Addr SP, Addr *start, Addr *end )
 {
    Stack* stack = find_stack_by_addr(SP);
-   NSegment const *stackseg = VG_(am_find_nsegment) (SP);
 
    if (LIKELY(stack)) {
       *start = stack->start;
       *end = stack->end;
    }
 
+   NSegment const *stackseg = VG_(am_find_nsegment) (SP);
    /* SP is assumed to be in a RW segment or in the SkResvn segment of an
       extensible stack (normally, only the main thread has an extensible
       stack segment).