|
From: <sv...@va...> - 2010-09-27 15:08:43
|
Author: tom
Date: 2010-09-27 16:08:34 +0100 (Mon, 27 Sep 2010)
New Revision: 11384
Log:
Calling VG_(am_relocate_nooverlap_client) will destroy the descriptor
for the old segment so we need to save the permissions from it before
the call so that we can use them when notifying tools of the new space
afterwards, or we will notify them of the wrong permissions.
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2010-09-27 02:20:38 UTC (rev 11383)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2010-09-27 15:08:34 UTC (rev 11384)
@@ -427,6 +427,9 @@
/* that failed. Look elsewhere. */
advised = VG_(am_get_advisory_client_simple)( 0, new_len, &ok );
if (ok) {
+ Bool oldR = old_seg->hasR;
+ Bool oldW = old_seg->hasW;
+ Bool oldX = old_seg->hasX;
/* assert new area does not overlap old */
vg_assert(advised+new_len-1 < old_addr
|| advised > old_addr+old_len-1);
@@ -437,8 +440,7 @@
MIN_SIZET(old_len,new_len) );
if (new_len > old_len)
VG_TRACK( new_mem_mmap, advised+old_len, new_len-old_len,
- old_seg->hasR, old_seg->hasW, old_seg->hasX,
- 0/*di_handle*/ );
+ oldR, oldW, oldX, 0/*di_handle*/ );
VG_TRACK(die_mem_munmap, old_addr, old_len);
if (d) {
VG_(discard_translations)( old_addr, old_len, "do_remap(4)" );
|