<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 - REGRESSION(202003): ASSERT(m_inTailPosition) in emitCallForwardArgumentsInTailPosition when useTailCalls=false"
   href="https://bugs.webkit.org/show_bug.cgi?id=166039">166039</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>REGRESSION(202003): ASSERT(m_inTailPosition) in emitCallForwardArgumentsInTailPosition when useTailCalls=false
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </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&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>msaboff&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Looks like when the new builtin opcode tailCallForwardArguments was added, there was no provision for when TailCalls were turned off.

I get this crash trace when running a debug Safari build with useTailCalls=false:

ASSERTION FAILED: m_inTailPosition
/Volumes/Data/src/wk/OpenSource/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp(3395) : JSC::RegisterID *JSC::BytecodeGenerator::emitCallForwardArgumentsInTailPosition(JSC::RegisterID *, JSC::RegisterID *, JSC::RegisterID *, JSC::RegisterID *, int32_t, const JSC::JSTextPosition &amp;, const JSC::JSTextPosition &amp;, const JSC::JSTextPosition &amp;, JSC::DebuggableCall)
1   0x10a1a0b3d WTFCrash
2   0x1093255f5 JSC::BytecodeGenerator::emitCallForwardArgumentsInTailPosition(JSC::RegisterID*, JSC::RegisterID*, JSC::RegisterID*, JSC::RegisterID*, int, JSC::JSTextPosition const&amp;, JSC::JSTextPosition const&amp;, JSC::JSTextPosition const&amp;, JSC::DebuggableCall)
3   0x109dd97fe JSC::BytecodeIntrinsicNode::emit_intrinsic_tailCallForwardArguments(JSC::BytecodeGenerator&amp;, JSC::RegisterID*)
4   0x109dd91c2 JSC::BytecodeIntrinsicNode::emitBytecode(JSC::BytecodeGenerator&amp;, JSC::RegisterID*)
5   0x10933ae3d JSC::BytecodeGenerator::emitNodeInTailPosition(JSC::RegisterID*, JSC::ExpressionNode*)
6   0x109deb034 JSC::ReturnNode::emitBytecode(JSC::BytecodeGenerator&amp;, JSC::RegisterID*)
7   0x109de815d JSC::BytecodeGenerator::emitNodeInTailPosition(JSC::RegisterID*, JSC::StatementNode*)
8   0x109de729b JSC::SourceElements::emitBytecode(JSC::BytecodeGenerator&amp;, JSC::RegisterID*)
9   0x109de7246 JSC::BlockNode::emitBytecode(JSC::BytecodeGenerator&amp;, JSC::RegisterID*)
10  0x109de815d JSC::BytecodeGenerator::emitNodeInTailPosition(JSC::RegisterID*, JSC::StatementNode*)
11  0x109de729b JSC::SourceElements::emitBytecode(JSC::BytecodeGenerator&amp;, JSC::RegisterID*)
12  0x109ded4b7 JSC::ScopeNode::emitStatementsBytecode(JSC::BytecodeGenerator&amp;, JSC::RegisterID*)
13  0x109dee59e JSC::FunctionNode::emitBytecode(JSC::BytecodeGenerator&amp;, JSC::RegisterID*)
14  0x109307dc1 JSC::BytecodeGenerator::generate()
15  0x10a07b1a5 JSC::ParserError JSC::BytecodeGenerator::generate&lt;JSC::FunctionNode*, JSC::UnlinkedFunctionCodeBlock*&amp;, JSC::DebuggerMode&amp;, JSC::VariableEnvironment const*&gt;(JSC::VM&amp;, JSC::FunctionNode*&amp;&amp;, JSC::UnlinkedFunctionCodeBlock*&amp;&amp;&amp;, JSC::DebuggerMode&amp;&amp;&amp;, JSC::VariableEnvironment const*&amp;&amp;)
16  0x10a07a008 JSC::generateUnlinkedFunctionCodeBlock(JSC::VM&amp;, JSC::UnlinkedFunctionExecutable*, JSC::SourceCode const&amp;, JSC::CodeSpecializationKind, JSC::DebuggerMode, JSC::UnlinkedFunctionKind, JSC::ParserError&amp;, JSC::SourceParseMode)
17  0x10a0798fe JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor(JSC::VM&amp;, JSC::SourceCode const&amp;, JSC::CodeSpecializationKind, JSC::DebuggerMode, JSC::ParserError&amp;, JSC::SourceParseMode)
18  0x109fe7cb9 JSC::ScriptExecutable::newCodeBlockFor(JSC::CodeSpecializationKind, JSC::JSFunction*, JSC::JSScope*, JSC::JSObject*&amp;)
19  0x109fe8c59 JSC::ScriptExecutable::prepareForExecutionImpl(JSC::VM&amp;, JSC::JSFunction*, JSC::JSScope*, JSC::CodeSpecializationKind, JSC::CodeBlock*&amp;)
20  0x109b50ef0 JSC::JSObject* JSC::ScriptExecutable::prepareForExecution&lt;JSC::FunctionExecutable&gt;(JSC::VM&amp;, JSC::JSFunction*, JSC::JSScope*, JSC::CodeSpecializationKind, JSC::CodeBlock*&amp;)
21  0x109d7c984 JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
22  0x109d7c310 JSC::LLInt::varargsSetup(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::LLInt::SetArgumentsWith)
23  0x109d7c01f llint_slow_path_call_varargs
24  0x109d89fcb llint_entry
25  0x109d89b95 llint_entry
26  0x109d89b95 llint_entry
27  0x109d89f06 llint_entry
28  0x109d89b95 llint_entry
29  0x109d89fdd llint_entry
30  0x109d89b95 llint_entry
31  0x109d89b95 llint_entry</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>