Follow-up to sys_ipc restructuration
authorphilippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Sun, 21 Oct 2012 21:49:33 +0000 (21:49 +0000)
committerphilippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Sun, 21 Oct 2012 21:49:33 +0000 (21:49 +0000)
Rev 13078 removed a PRE call (for SEMCTL) in the POST(sys_ipc).
This commit adds the correct POST call for SEMCTL in POST(sys_ipc).
(note: some tests are missing in this area, as removing PRE
and adding POST did not cause any test result to change).

This is the last patch to restructure the sys_ipc code.

After this patch, should be able to do the real fix
for 23837 (semctl GETVAL false positive)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13079 a5019735-40e9-0310-863c-91ae7b9d1cf9

coregrind/m_syswrap/syswrap-linux.c

index 28a12b4377c47f0adaaea55c5592e0e714c85539..afd4c2e6fc31bbaf9515b8af58901e804785b00a 100644 (file)
@@ -3303,7 +3303,8 @@ static Addr deref_Addr ( ThreadId tid, Addr a, Char* s )
 
 PRE(sys_ipc)
 {
-   PRINT("sys_ipc ( %ld, %ld, %ld, %ld, %#lx, %ld )", ARG1,ARG2,ARG3,ARG4,ARG5,ARG6);
+   PRINT("sys_ipc ( %ld, %ld, %ld, %ld, %#lx, %ld )",
+         ARG1,ARG2,ARG3,ARG4,ARG5,ARG6);
    // XXX: this is simplistic -- some args are not used in all circumstances.
    PRE_REG_READ6(int, "ipc",
                  vki_uint, call, int, first, int, second, int, third,
@@ -3387,8 +3388,13 @@ POST(sys_ipc)
    switch (ARG1 /* call */) {
    case VKI_SEMOP:
    case VKI_SEMGET:
+      break;
    case VKI_SEMCTL:
+   {
+      UWord arg = deref_Addr( tid, ARG5, "semctl(arg)" );
+      ML_(generic_POST_sys_semctl)( tid, RES, ARG2, ARG3, ARG4, arg );
       break;
+   }
    case VKI_SEMTIMEDOP:
    case VKI_MSGSND:
       break;