Commit 75302c02 authored by Kathleen Brade's avatar Kathleen Brade Committed by Georg Koppen
Browse files

Bug 19212: SIGSEGV with developer tools open

Avoid a crash when monitoring network events. The crash occurred
because the JS context's compartment was NULL when a JS stack was
requested, but the root cause remains a mystery.
parent 65036896
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -6223,7 +6223,9 @@ JS_PUBLIC_API(bool)
JS::CaptureCurrentStack(JSContext* cx, JS::MutableHandleObject stackp, unsigned maxFrameCount)
{
    JSCompartment* compartment = cx->compartment();
    MOZ_ASSERT(compartment);
    if (!compartment)
      return false;

    Rooted<SavedFrame*> frame(cx);
    if (!compartment->savedStacks().saveCurrentStack(cx, &frame, maxFrameCount))
        return false;