Commit c94835f7 authored by Simon McVittie's avatar Simon McVittie
Browse files

Fix IA64 patch so it doesn't break !ia64 machines

The conditional section was slightly too long, resulting in the final
"return p" being #ifdef'd out on all non-ia64 architectures. This led
to ReserveProcessExecutableMemory() returning an undefined value,
which it appears was often NULL in practice.

Closes: #902961
parent 88706dc2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -10,6 +10,9 @@ mozjs52 (52.3.1-9) UNRELEASED; urgency=medium
    of mozjs52 compiled before Debian had icu-le-hb available, we didn't
    try to build that feature, so not having it is not a regression.
    Patch from Mike Hommey, via mozilla-unified. (Closes: #902197)
  * d/p/ia64-support.patch:
    Fix IA64 patch so it doesn't leave ReserveProcessExecutableMemory()
    returning an undefined result on !ia64 machines (Closes: #902961)

 -- Simon McVittie <smcv@debian.org>  Wed, 04 Jul 2018 00:22:07 +0100

+5 −4
Original line number Diff line number Diff line
@@ -2,16 +2,18 @@ From: Jason Duerstock <jason.duerstock@gmail.com>
Date: Sun, 29 Apr 2018 09:16:20 -0400
Subject: On ia64, retry failed mmap without address hint

[smcv: Move the #endif so we still return a defined value on non-ia64]
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897178
Last-Updated: 2018-07-10
---
 js/src/jit/ProcessExecutableMemory.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/js/src/jit/ProcessExecutableMemory.cpp b/js/src/jit/ProcessExecutableMemory.cpp
index 71c2ab0..31836f1 100644
index 71c2ab0..89b5dfe 100644
--- a/js/src/jit/ProcessExecutableMemory.cpp
+++ b/js/src/jit/ProcessExecutableMemory.cpp
@@ -290,9 +290,20 @@ ReserveProcessExecutableMemory(size_t bytes)
@@ -290,8 +290,19 @@ ReserveProcessExecutableMemory(size_t bytes)
     void* randomAddr = ComputeRandomAllocationAddress();
     void* p = MozTaggedAnonymousMmap(randomAddr, bytes, PROT_NONE, MAP_PRIVATE | MAP_ANON,
                                      -1, 0, "js-executable-memory");
@@ -27,8 +29,7 @@ index 71c2ab0..31836f1 100644
+        if (p == MAP_FAILED)
+            return nullptr;
+    }
     return p;
+#endif
     return p;
 }
 
 static void