<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - JSC::JSWebAssemblyModule::createStub() falls through ASSERT_NOT_REACHED()"
   href="https://bugs.webkit.org/show_bug.cgi?id=234971">234971</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>JSC::JSWebAssemblyModule::createStub() falls through ASSERT_NOT_REACHED()
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned@lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ddkilzer@webkit.org
          </td>
        </tr>

        <tr>
          <th>Depends on</th>
          <td>234932
          </td>
        </tr></table>
      <p>
        <div>
        <pre>JSC::JSWebAssemblyModule::createStub() falls through ASSERT_NOT_REACHED().

These fall-throughs should either use RELEASE_ASSERT_NOT_REACHED(), or add a `return nullptr;` statement after ASSERT_NOT_REACHED().

Presumably the switch statement will never fall through unless there is memory corruption, so a RELEASE_ASSERT_NOT_REACHED() would catch such corruption much earlier.

JSWebAssemblyModule* JSWebAssemblyModule::createStub(VM& vm, JSGlobalObject* globalObject, Structure* structure, Wasm::Module::ValidationResult&& result)
{
    [...]
    auto error = module->generateWasmToJSStubs(vm);
    if (UNLIKELY(!error)) {
        switch (error.error()) {
        case Wasm::BindingFailure::OutOfMemory:
            throwException(globalObject, scope, createJSWebAssemblyLinkError(globalObject, vm, "Out of executable memory"_s));
            return nullptr;
        }
        ASSERT_NOT_REACHED();
    }
    return module;
}

See Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp.</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - check-webkit-style: add checker for unexpected fall through after ASSERT_NOT_REACHED() statements"
   href="https://bugs.webkit.org/show_bug.cgi?id=234932">Bug 234932</a>] check-webkit-style: add checker for unexpected fall through after ASSERT_NOT_REACHED() statements
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>