Bug 1445947 - Remove re-protection warnings from Windows VirtualProtect calls. r=ehoogeveen
authorNicolas B. Pierron <nicolas.b.pierron@gmail.com>
Thu, 15 Mar 2018 14:09:57 +0000
changeset 408493 a337823240097ac828b71564fd6c9e39fa10bb90
parent 408492 0ff6ecf81af7c33f7dd290a6e53d6850dcec66f4
child 408494 89636146c87476e52b9e7a4787e89ab789e00a02
push id100959
push usernpierron@mozilla.com
push dateFri, 16 Mar 2018 14:04:09 +0000
treeherdermozilla-inbound@a33782324009 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehoogeveen
bugs1445947
milestone61.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 1445947 - Remove re-protection warnings from Windows VirtualProtect calls. r=ehoogeveen
js/src/gc/Memory.cpp
--- a/js/src/gc/Memory.cpp
+++ b/js/src/gc/Memory.cpp
@@ -854,17 +854,16 @@ ProtectPages(void* p, size_t size)
     MOZ_RELEASE_ASSERT(size > 0);
     MOZ_RELEASE_ASSERT(p);
 #if defined(XP_WIN)
     DWORD oldProtect;
     if (!VirtualProtect(p, size, PAGE_NOACCESS, &oldProtect)) {
         MOZ_CRASH_UNSAFE_PRINTF("VirtualProtect(PAGE_NOACCESS) failed! Error code: %lu",
                                 GetLastError());
     }
-    MOZ_ASSERT(oldProtect == PAGE_READWRITE);
 #else  // assume Unix
     if (mprotect(p, size, PROT_NONE))
         MOZ_CRASH("mprotect(PROT_NONE) failed");
 #endif
 }
 
 void
 MakePagesReadOnly(void* p, size_t size)
@@ -873,17 +872,16 @@ MakePagesReadOnly(void* p, size_t size)
     MOZ_RELEASE_ASSERT(size > 0);
     MOZ_RELEASE_ASSERT(p);
 #if defined(XP_WIN)
     DWORD oldProtect;
     if (!VirtualProtect(p, size, PAGE_READONLY, &oldProtect)) {
         MOZ_CRASH_UNSAFE_PRINTF("VirtualProtect(PAGE_READONLY) failed! Error code: %lu",
                                 GetLastError());
     }
-    MOZ_ASSERT(oldProtect == PAGE_READWRITE);
 #else  // assume Unix
     if (mprotect(p, size, PROT_READ))
         MOZ_CRASH("mprotect(PROT_READ) failed");
 #endif
 }
 
 void
 UnprotectPages(void* p, size_t size)
@@ -892,17 +890,16 @@ UnprotectPages(void* p, size_t size)
     MOZ_RELEASE_ASSERT(size > 0);
     MOZ_RELEASE_ASSERT(p);
 #if defined(XP_WIN)
     DWORD oldProtect;
     if (!VirtualProtect(p, size, PAGE_READWRITE, &oldProtect)) {
         MOZ_CRASH_UNSAFE_PRINTF("VirtualProtect(PAGE_READWRITE) failed! Error code: %lu",
                                 GetLastError());
     }
-    MOZ_ASSERT(oldProtect == PAGE_NOACCESS || oldProtect == PAGE_READONLY);
 #else  // assume Unix
     if (mprotect(p, size, PROT_READ | PROT_WRITE))
         MOZ_CRASH("mprotect(PROT_READ | PROT_WRITE) failed");
 #endif
 }
 
 } // namespace gc
 } // namespace js