diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp index 9b3e82c280d5..2606317e8942 100644 --- a/js/src/gc/GC.cpp +++ b/js/src/gc/GC.cpp @@ -2144,7 +2144,9 @@ GCRuntime::shouldCompact() bool GCRuntime::isCompactingGCEnabled() const { - return compactingEnabled && rt->mainContextFromOwnThread()->compactingDisabledCount == 0; + return compactingEnabled + && rt->mainContextFromOwnThread()->compactingDisabledCount == 0 + && !mozilla::recordreplay::IsRecordingOrReplaying(); } AutoDisableCompactingGC::AutoDisableCompactingGC(JSContext* cx)