Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-10-13 20:47:32 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-10-13 20:47:32 +0400
commit76173acf28058262b31e129cb90fa7f478413e34 (patch)
tree6ddd6e2025dddcf2e614a10c2e620694ff517453 /winsup/cygwin/path.cc
parent40187f9007a4d781f9a420389acce210eb78b74b (diff)
* path.cc (find_fast_cwd_pointer): Allow 'push crit-sect-addr' instead
of 'mov edi, crit-sect-addr; push edi' and set rcall accordingly.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index f9ed0dc06..45583fb76 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3665,9 +3665,13 @@ find_fast_cwd_pointer ()
/* Find first "push edi" instruction. */
const uint8_t *pushedi = (const uint8_t *) memchr (use_cwd, 0x57, 32);
/* ...which should be followed by "mov edi, crit-sect-addr" then
- "push edi". */
+ "push edi", or by just a single "push crit-sect-addr". */
const uint8_t *movedi = pushedi + 1;
- if (movedi[0] != 0xbf || movedi[5] != 0x57)
+ if (movedi[0] == 0xbf && movedi[5] == 0x57)
+ rcall = movedi + 6;
+ else if (movedi[0] == 0x68)
+ rcall = movedi + 5;
+ else
return NULL;
/* Compare the address used for the critical section with the known
PEB lock as stored in the PEB. */
@@ -3676,7 +3680,6 @@ find_fast_cwd_pointer ()
return NULL;
/* To check we are seeing the right code, we check our expectation that
the next instruction is a relative call into RtlEnterCriticalSection. */
- rcall = movedi + 6;
if (rcall[0] != 0xe8)
return NULL;
/* Check that this is a relative call to RtlEnterCriticalSection. */