Bug 234965 - Web Inspector: Inspector::RemoteInspector::receivedSetupMessage() falls through ASSERT_NOT_REACHED()
Summary: Web Inspector: Inspector::RemoteInspector::receivedSetupMessage() falls throu...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 234932
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-07 10:33 PST by David Kilzer (:ddkilzer)
Modified: 2022-01-07 11:13 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2022-01-07 10:33:40 PST
Inspector::RemoteInspector::receivedSetupMessage() falls through ASSERT_NOT_REACHED().

Since there are many other early returns in this method, it seems like there should be an early return after ASSERT_NOT_REACHED() as well.

void RemoteInspector::receivedSetupMessage(NSDictionary *userInfo)
{
    [...]
    if (is<RemoteInspectionTarget>(target)) {
        bool isAutomaticInspection = m_automaticInspectionCandidateTargetIdentifier == target->targetIdentifier();

        if (!connectionToTarget->setup(isAutomaticInspection, automaticallyPause)) {
            connectionToTarget->close();
            return;
        }
        m_targetConnectionMap.set(targetIdentifier, WTFMove(connectionToTarget));
    } else if (is<RemoteAutomationTarget>(target)) {
        if (!connectionToTarget->setup()) {
            connectionToTarget->close();
            return;
        }
        m_targetConnectionMap.set(targetIdentifier, WTFMove(connectionToTarget));
    } else
        ASSERT_NOT_REACHED();

    updateHasActiveDebugSession();
}

See Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm.
Comment 1 Radar WebKit Bug Importer 2022-01-07 10:33:54 PST
<rdar://problem/87260301>