|
From: <sv...@va...> - 2005-10-06 14:49:28
|
Author: tom
Date: 2005-10-06 15:49:21 +0100 (Thu, 06 Oct 2005)
New Revision: 4882
Log:
When looking for a heap segment to extend look for the heap limit
address rather than the base address as the heap may have been split
into more than one segment by using mprotect on it...
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2005-10-06 12:06:03 UTC (=
rev 4881)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-10-06 14:49:21 UTC (=
rev 4882)
@@ -952,7 +952,10 @@
}
=20
/* otherwise we're expanding the brk segment. */
- aseg =3D VG_(am_find_nsegment)( VG_(brk_base) );
+ if (VG_(brk_limit) > VG_(brk_base))
+ aseg =3D VG_(am_find_nsegment)( VG_(brk_limit)-1 );
+ else
+ aseg =3D VG_(am_find_nsegment)( VG_(brk_limit) );
rseg =3D VG_(am_next_nsegment)( aseg, True/*forwards*/ );
=20
/* These should be assured by setup_client_dataseg in m_main. */
|