Bug 1131436 - WindowsDllInterceptor is always failure with --disable-optimize and --enable-debug. r=dmajor
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 12 Feb 2015 15:07:57 +0900
changeset 255908 4491d42a2c351dcf5567dac9c9edeb59b306dd26
parent 255907 6ed69c4d2c15c183a114869c78f186b6e7dbc5c1
child 255909 ea7de6b88d853f2c69d1bcc82e873ef3ed8635c7
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1131436
milestone38.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 1131436 - WindowsDllInterceptor is always failure with --disable-optimize and --enable-debug. r=dmajor
xpcom/build/nsWindowsDllInterceptor.h
--- a/xpcom/build/nsWindowsDllInterceptor.h
+++ b/xpcom/build/nsWindowsDllInterceptor.h
@@ -673,16 +673,22 @@ protected:
   static void* ResolveRedirectedAddress(const byteptr_t aOriginalFunction)
   {
 #if defined(_M_IX86)
     // If function entry is jmp [disp32] such as used by kernel32,
     // we resolve redirected address from import table.
     if (aOriginalFunction[0] == 0xff && aOriginalFunction[1] == 0x25) {
       return (void*)(**((uint32_t**) (aOriginalFunction + 2)));
     }
+#elif defined(_M_X64)
+    if (aOriginalFunction[0] == 0xe9) {
+      // require for TestDllInterceptor with --disable-optimize
+      int32_t offset = *((int32_t*)(aOriginalFunction + 1));
+      return aOriginalFunction + 5 + offset;
+    }
 #endif
 
     return aOriginalFunction;
   }
 };
 
 } // namespace internal