Author: tom
Date: 2008-02-11 14:47:05 +0000 (Mon, 11 Feb 2008)
New Revision: 7399

Log:
Always call ML_(generic_POST_sys_shmat) when a shmat call succeeds, even
if the memory was attached at address zero. Fixes bug #157665.


Modified:
   trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
   trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c
   trunk/coregrind/m_syswrap/syswrap-x86-linux.c


Modified: trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c     2008-02-11 11:34:59 UTC 
(rev 7398)
+++ trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c     2008-02-11 14:47:05 UTC 
(rev 7399)
@@ -890,9 +890,7 @@
       POST_MEM_WRITE( ARG4, sizeof( Addr ) );
 
       addr = deref_Addr ( tid, ARG4, "shmat(addr)" );
-      if ( addr > 0 ) {
-       ML_(generic_POST_sys_shmat)( tid, addr, ARG2, ARG5, ARG3 );
-      }
+      ML_(generic_POST_sys_shmat)( tid, addr, ARG2, ARG5, ARG3 );
       break;
     }
   case VKI_SHMDT:

Modified: trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c     2008-02-11 11:34:59 UTC 
(rev 7398)
+++ trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c     2008-02-11 14:47:05 UTC 
(rev 7399)
@@ -904,9 +904,7 @@
       POST_MEM_WRITE( ARG4, sizeof( Addr ) );
 
       addr = deref_Addr ( tid, ARG4, "shmat(addr)" );
-      if ( addr > 0 ) {
-       ML_(generic_POST_sys_shmat)( tid, addr, ARG2, ARG5, ARG3 );
-      }
+      ML_(generic_POST_sys_shmat)( tid, addr, ARG2, ARG5, ARG3 );
       break;
     }
   case VKI_SHMDT:

Modified: trunk/coregrind/m_syswrap/syswrap-x86-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-x86-linux.c       2008-02-11 11:34:59 UTC 
(rev 7398)
+++ trunk/coregrind/m_syswrap/syswrap-x86-linux.c       2008-02-11 14:47:05 UTC 
(rev 7399)
@@ -1281,9 +1281,7 @@
       POST_MEM_WRITE( ARG4, sizeof( Addr ) );
 
       addr = deref_Addr ( tid, ARG4, "shmat(addr)" );
-      if ( addr > 0 ) { 
-         ML_(generic_POST_sys_shmat)( tid, addr, ARG2, ARG5, ARG3 );
-      }
+      ML_(generic_POST_sys_shmat)( tid, addr, ARG2, ARG5, ARG3 );
       break;
    }
    case VKI_SHMDT:


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to