Ignore:
Timestamp:
Mar 29, 2022, 3:10:45 PM (3 years ago)
Author:
Patrick Angle
Message:

Web Inspector: Add check for null entryScope in JSC::Debugger::detach
https://bugs.webkit.org/show_bug.cgi?id=238518

Reviewed by Devin Rousso.

A virtual machine may not always have an entryScope, which can occur if a JSGlobalObject is being destructed
(which will call into JSC::Debugger::Detach) before a VMEntryScope is created or after a VMEntryScope has
fallen out of scope, causing the VM's entryScope to be null again. In the original internal issue that led to
finding this, this most commonly occurred in conjunction with page refresh while the debugger was paused.

Because it is possible that we were previously paused in the VM that now has no entryScope, we should go ahead
and unpause.

  • debugger/Debugger.cpp:

(JSC::Debugger::detach):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/debugger/Debugger.cpp

    r291517 r292075  
    172172    JSLockHolder locker(vm);
    173173
    174     if (m_isPaused && m_currentCallFrame && vm.entryScope->globalObject() == globalObject) {
     174    if (m_isPaused && m_currentCallFrame && (!vm.isEntered() || vm.entryScope->globalObject() == globalObject)) {
    175175        m_currentCallFrame = nullptr;
    176176        m_pauseOnCallFrame = nullptr;
Note: See TracChangeset for help on using the changeset viewer.