From: Julian Seward Date: Mon, 26 Jan 2009 15:00:15 +0000 (+0000) Subject: merge r9051: X-Git-Tag: svn/VALGRIND_3_4_1~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13f713d2e89a1f2817e55b9ff66c63f0699cd496;p=thirdparty%2Fvalgrind.git merge r9051: VG_(apply_StackTrace): following r8818, we should regard an entry of -1 as denoting the logical end of the stack. git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_4_BRANCH@9072 --- diff --git a/coregrind/m_stacktrace.c b/coregrind/m_stacktrace.c index bd1e42a6cf..687d2062f5 100644 --- a/coregrind/m_stacktrace.c +++ b/coregrind/m_stacktrace.c @@ -561,7 +561,13 @@ void VG_(apply_StackTrace)( void(*action)(UInt n, Addr ip), action(i, ip); i++; - } while (i < n_ips && ips[i] != 0 && !main_done); + // re 'while' condition: stop if we hit a zero value (the traditional + // end-of-stack marker) or a ~0 value. The latter because r8818 + // (in this file) changes the meaning of entries [1] and above in a + // stack trace, by subtracting 1 from them. Hence stacks that used + // to end with a zero value now end in -1 and so we must detect + // that too. + } while (i < n_ips && ips[i] != 0 && ips[i] != ~(Addr)0 && !main_done); #undef MYBUF_LEN }