|
From: <sv...@va...> - 2008-05-02 17:27:09
|
Author: bart
Date: 2008-05-02 18:27:08 +0100 (Fri, 02 May 2008)
New Revision: 7990
Log:
Added an assert statement to check the validity of the computed highest used stack address.
Modified:
trunk/exp-drd/drd_clientreq.c
Modified: trunk/exp-drd/drd_clientreq.c
===================================================================
--- trunk/exp-drd/drd_clientreq.c 2008-05-02 13:35:29 UTC (rev 7989)
+++ trunk/exp-drd/drd_clientreq.c 2008-05-02 17:27:08 UTC (rev 7990)
@@ -92,10 +92,15 @@
UInt nframes;
const UInt n_ips = 10;
Addr ips[n_ips], sps[n_ips];
+ Addr husa;
nframes = VG_(get_StackTrace)(vg_tid, ips, n_ips, sps, 0, 0);
- return (nframes >= 1 ? sps[nframes - 1] : VG_(get_SP)(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
+ && husa <= VG_(thread_get_stack_max)(vg_tid));
+ return husa;
}
static Bool drd_handle_client_request(ThreadId vg_tid, UWord* arg, UWord* ret)
|