]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added yet another assertion statement.
authorBart Van Assche <bvanassche@acm.org>
Fri, 2 May 2008 19:12:43 +0000 (19:12 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 2 May 2008 19:12:43 +0000 (19:12 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7992

exp-drd/drd_clientreq.c

index 7a7c5ec3bc7f20c483f487478cdb200039cc1c69..053c14c51162e59458f29b20ba548b21d610f4bb 100644 (file)
@@ -96,6 +96,11 @@ static Addr highest_used_stack_address(const ThreadId vg_tid)
 
     nframes = VG_(get_StackTrace)(vg_tid, ips, n_ips, sps, 0, 0);
 
+    /* Paranoia ... */
+    tl_assert(VG_(thread_get_stack_max)(vg_tid)
+              - VG_(thread_get_stack_size)(vg_tid) <= VG_(get_SP)(vg_tid)
+              && VG_(get_SP)(vg_tid) <= VG_(thread_get_stack_max)(vg_tid));
+
     husa = (nframes >= 1 ? sps[nframes - 1] : VG_(get_SP)(vg_tid));
     tl_assert(VG_(thread_get_stack_max)(vg_tid)
               - VG_(thread_get_stack_size)(vg_tid) <= husa