Bug 1435360 - Baldr: jit::EnsureAsyncInterrupt() shouldn't cause JSRuntime failure if there is no async interrupt support on CLOSED TREE (r=me)

This commit is contained in:
Luke Wagner 2018-03-09 14:56:44 -06:00
parent bc31413f8e
commit 1ce292d679
3 changed files with 5 additions and 7 deletions

View File

@ -81,12 +81,12 @@ JitAsyncInterruptHandler(int signum, siginfo_t*, void*)
static bool sTriedInstallAsyncInterrupt = false;
static bool sHaveAsyncInterrupt = false;
bool
void
jit::EnsureAsyncInterrupt(JSContext* cx)
{
// We assume that there are no races creating the first JSRuntime of the process.
if (sTriedInstallAsyncInterrupt)
return sHaveAsyncInterrupt;
return;
sTriedInstallAsyncInterrupt = true;
#if defined(ANDROID) && !defined(__aarch64__)
@ -99,7 +99,7 @@ jit::EnsureAsyncInterrupt(JSContext* cx)
PodArrayZero(version_string);
if (__system_property_get("ro.build.version.sdk", version_string) > 0) {
if (atol(version_string) < 19)
return false;
return;
}
#endif
@ -125,7 +125,6 @@ jit::EnsureAsyncInterrupt(JSContext* cx)
#endif // defined(XP_WIN)
sHaveAsyncInterrupt = true;
return true;
}
bool

View File

@ -15,7 +15,7 @@ namespace jit {
// Ensure the given JSRuntime is set up to use async interrupts. Failure to
// enable signal handlers indicates some catastrophic failure and creation of
// the runtime must fail.
MOZ_MUST_USE bool
void
EnsureAsyncInterrupt(JSContext* cx);
// Return whether the async interrupt can be used to interrupt Ion code.

View File

@ -128,8 +128,7 @@ JSContext::init(ContextKind kind)
return false;
#endif
if (!jit::EnsureAsyncInterrupt(this))
return false;
jit::EnsureAsyncInterrupt(this);
if (!wasm::EnsureSignalHandlers(this))
return false;
}