Bug 652747 - 64-bit Nightly [build 25-04-2011] crashes on launch in DLL Blacklist code with certain antivirus software installed. r=vlad
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Sun, 08 May 2011 22:27:50 +0900
changeset 69352 d275b0e6e877c6d87db3927b1f451a5836b72203
parent 69351 c6f971864dde0a456ab6d598150d9edb691f58ca
child 69355 a06feeb6375aa945b65909e9667daf78c1011162
push id76
push userbzbarsky@mozilla.com
push dateTue, 05 Jul 2011 17:00:57 +0000
treeherdermozilla-beta@d3a2732c35f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad
bugs652747
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 652747 - 64-bit Nightly [build 25-04-2011] crashes on launch in DLL Blacklist code with certain antivirus software installed. r=vlad
toolkit/xre/nsWindowsDllInterceptor.h
--- a/toolkit/xre/nsWindowsDllInterceptor.h
+++ b/toolkit/xre/nsWindowsDllInterceptor.h
@@ -180,22 +180,22 @@ protected:
         // PUSH imm8
         nBytes += 2;
       } else {
         //printf ("Unknown x86 instruction byte 0x%02x, aborting trampoline\n", origBytes[nBytes]);
         return 0;
       }
     }
 #elif defined(_M_X64)
-    int pJmp32 = 0;
+    int pJmp32 = -1;
 
     while (nBytes < 13) {
 
       // if found JMP 32bit offset, next bytes must be NOP 
-      if (pJmp32) {
+      if (pJmp32 >= 0) {
         if (origBytes[nBytes++] != 0x90)
           return 0;
 
         continue;
       } 
         
       if (origBytes[nBytes] == 0x41) {
         // REX.B
@@ -306,17 +306,17 @@ protected:
     // OrigFunction+N, the target of the trampoline
     byteptr_t trampDest = origBytes + nBytes;
 
 #if defined(_M_IX86)
     tramp[nBytes] = 0xE9; // jmp
     *((intptr_t*)(tramp+nBytes+1)) = (intptr_t)trampDest - (intptr_t)(tramp+nBytes+5); // target displacement
 #elif defined(_M_X64)
     // If JMP32 opcode found, we don't insert to trampoline jump 
-    if (pJmp32) {
+    if (pJmp32 >= 0) {
       // convert JMP 32bit offset to JMP 64bit direct
       byteptr_t directJmpAddr = origBytes + pJmp32 + 5 + (*((LONG*)(origBytes+pJmp32+1)));
       // mov r11, address
       tramp[pJmp32]   = 0x49;
       tramp[pJmp32+1] = 0xbb;
       *((intptr_t*)(tramp+pJmp32+2)) = (intptr_t)directJmpAddr;
 
       // jmp r11