|
From: <sv...@va...> - 2011-05-16 11:49:49
|
Author: sewardj
Date: 2011-05-16 12:49:40 +0100 (Mon, 16 May 2011)
New Revision: 11761
Log:
Reorder tests poking around in the x86 instruction stream (sigh)
in order to try and avoid segfaults when we back up over a page
boundary.
Modified:
trunk/exp-sgcheck/sg_main.c
Modified: trunk/exp-sgcheck/sg_main.c
===================================================================
--- trunk/exp-sgcheck/sg_main.c 2011-05-15 17:53:26 UTC (rev 11760)
+++ trunk/exp-sgcheck/sg_main.c 2011-05-16 11:49:40 UTC (rev 11761)
@@ -2135,9 +2135,9 @@
#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;
}
|