[tbb-commits] [tor-browser/tor-browser-52.0.2esr-7.0-2] Backport of tjr's patch for bug 1331349

gk at torproject.org gk at torproject.org
Wed Apr 5 20:00:21 UTC 2017


commit d4b359c42ae2dbd3ab6406cdf99db796602aaedf
Author: Georg Koppen <gk at torproject.org>
Date:   Wed Feb 1 11:52:36 2017 +0000

    Backport of tjr's patch for bug 1331349
---
 js/src/gc/Memory.cpp | 6 +++---
 mfbt/Attributes.h    | 5 ++++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp
index 00f3c23..981ecc0 100644
--- a/js/src/gc/Memory.cpp
+++ b/js/src/gc/Memory.cpp
@@ -854,7 +854,7 @@ ProtectPages(void* p, size_t size)
     DWORD oldProtect;
     if (!VirtualProtect(p, size, PAGE_NOACCESS, &oldProtect)) {
         snprintf(sCrashReason, sizeof(sCrashReason),
-            "MOZ_CRASH(VirtualProtect(PAGE_NOACCESS) failed! Error code: %u)", GetLastError());
+            "MOZ_CRASH(VirtualProtect(PAGE_NOACCESS) failed! Error code: %lu)", GetLastError());
         MOZ_CRASH_ANNOTATE(sCrashReason);
         MOZ_REALLY_CRASH();
     }
@@ -875,7 +875,7 @@ MakePagesReadOnly(void* p, size_t size)
     DWORD oldProtect;
     if (!VirtualProtect(p, size, PAGE_READONLY, &oldProtect)) {
         snprintf(sCrashReason, sizeof(sCrashReason),
-            "MOZ_CRASH(VirtualProtect(PAGE_READONLY) failed! Error code: %u)", GetLastError());
+            "MOZ_CRASH(VirtualProtect(PAGE_READONLY) failed! Error code: %lu)", GetLastError());
         MOZ_CRASH_ANNOTATE(sCrashReason);
         MOZ_REALLY_CRASH();
     }
@@ -896,7 +896,7 @@ UnprotectPages(void* p, size_t size)
     DWORD oldProtect;
     if (!VirtualProtect(p, size, PAGE_READWRITE, &oldProtect)) {
         snprintf(sCrashReason, sizeof(sCrashReason),
-            "MOZ_CRASH(VirtualProtect(PAGE_READWRITE) failed! Error code: %u)", GetLastError());
+            "MOZ_CRASH(VirtualProtect(PAGE_READWRITE) failed! Error code: %lu)", GetLastError());
         MOZ_CRASH_ANNOTATE(sCrashReason);
         MOZ_REALLY_CRASH();
     }
diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h
index df6172f..bcd393c 100644
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -594,7 +594,10 @@
  * PR_snprintf and friends, which are "printf-like" but which assign
  * different meanings to the various formats.
  */
-#ifdef __GNUC__
+#ifdef __MINGW__
+#define MOZ_FORMAT_PRINTF(stringIndex, firstToCheck)  \
+    __attribute__ ((format (ms_printf, stringIndex, firstToCheck)))
+#elseif __GNUC__
 #define MOZ_FORMAT_PRINTF(stringIndex, firstToCheck)  \
     __attribute__ ((format (printf, stringIndex, firstToCheck)))
 #else





More information about the tbb-commits mailing list