From 182619548e9c215f61083e3c4932d8aff6901cac Mon Sep 17 00:00:00 2001 From: David Major Date: Tue, 3 Jun 2014 16:47:43 +1200 Subject: [PATCH] Bug 1018477: Fix R/M check in x86 detour code. r=m_kato --- xpcom/build/nsWindowsDllInterceptor.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xpcom/build/nsWindowsDllInterceptor.h b/xpcom/build/nsWindowsDllInterceptor.h index 9c6e3300dd2..afedc2aeda7 100644 --- a/xpcom/build/nsWindowsDllInterceptor.h +++ b/xpcom/build/nsWindowsDllInterceptor.h @@ -355,9 +355,14 @@ protected: { // REG=r, R/M=r or REG=r, R/M=[r] nBytes += 2; - } else if (((b & 0xc0) == 0x40) && ((b & 0x38) != 0x20)) { - // REG=r, R/M=[r + disp8] - nBytes += 3; + } else if ((b & 0xc0) == 0x40) { + if ((b & 0x07) == 0x04) { + // REG=r, R/M=[SIB + disp8] + nBytes += 4; + } else { + // REG=r, R/M=[r + disp8] + nBytes += 3; + } } else { // complex MOV, bail return;