<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>234965</bug_id>
          
          <creation_ts>2022-01-07 10:33:40 -0800</creation_ts>
          <short_desc>Web Inspector: Inspector::RemoteInspector::receivedSetupMessage() falls through ASSERT_NOT_REACHED()</short_desc>
          <delta_ts>2022-01-07 11:13:57 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=234971</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>234932</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>inspector-bugzilla-changes</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1828965</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2022-01-07 10:33:40 -0800</bug_when>
    <thetext>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&lt;RemoteInspectionTarget&gt;(target)) {
        bool isAutomaticInspection = m_automaticInspectionCandidateTargetIdentifier == target-&gt;targetIdentifier();

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

    updateHasActiveDebugSession();
}

See Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1828966</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-01-07 10:33:54 -0800</bug_when>
    <thetext>&lt;rdar://problem/87260301&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>