Bug 1465470 Part 7 - Avoid calling getenv at non-deterministic points in the JS engine, r=jandem.

--HG--
extra : rebase_source : 0bb17c91e14565fe5d0b6fa87dce05e2d7ff4d14
This commit is contained in:
Brian Hackett 2018-07-23 15:04:54 +00:00
parent 871f2e4852
commit b5f74e9778
2 changed files with 6 additions and 1 deletions

View File

@ -345,7 +345,8 @@ AlwaysPoison(void* ptr, uint8_t value, size_t num, MemCheckKind kind)
static inline void
Poison(void* ptr, uint8_t value, size_t num, MemCheckKind kind)
{
static bool disablePoison = bool(getenv("JSGC_DISABLE_POISONING"));
static bool disablePoison = !mozilla::recordreplay::IsRecordingOrReplaying()
&& bool(getenv("JSGC_DISABLE_POISONING"));
if (!disablePoison)
AlwaysPoison(ptr, value, num, kind);
}

View File

@ -172,6 +172,8 @@ js::InferSpewActive(SpewChannel channel)
if (!checked) {
checked = true;
PodArrayZero(active);
if (mozilla::recordreplay::IsRecordingOrReplaying())
return false;
const char* env = getenv("INFERFLAGS");
if (!env)
return false;
@ -194,6 +196,8 @@ static bool InferSpewColorable()
static bool checked = false;
if (!checked) {
checked = true;
if (mozilla::recordreplay::IsRecordingOrReplaying())
return false;
const char* env = getenv("TERM");
if (!env)
return false;