]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Reorder tests poking around in the x86 instruction stream (sigh)
authorJulian Seward <jseward@acm.org>
Mon, 16 May 2011 11:49:40 +0000 (11:49 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 16 May 2011 11:49:40 +0000 (11:49 +0000)
in order to try and avoid segfaults when we back up over a page
boundary.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11761

exp-sgcheck/sg_main.c

index f125abe8391aa5a832b3ac3702780285a2fb0f51..ea384c945d4b32b0016219e40142a22a0761d358 100644 (file)
@@ -2135,9 +2135,9 @@ static void instrument_mem_access ( struct _SGEnv* sge,
 #if defined(VGA_x86)
    { UChar* p = (UChar*)curr_IP;
      // pop %ebp; RET
-     if (p[-1] == 0x5d && p[0] == 0xc3) return;
+     if (p[0] == 0xc3 && p[-1] == 0x5d) return;
      // pop %ebp; RET $imm16
-     if (p[-1] == 0x5d && p[0] == 0xc2) return;
+     if (p[0] == 0xc2 && p[-1] == 0x5d) return;
      // PUSH %EBP; mov %esp,%ebp
      if (p[0] == 0x55 && p[1] == 0x89 && p[2] == 0xe5) return;
    }