<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - RangeError with deep self recursion (Proper tail call)"
   href="https://bugs.webkit.org/show_bug.cgi?id=163663#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - RangeError with deep self recursion (Proper tail call)"
   href="https://bugs.webkit.org/show_bug.cgi?id=163663">bug 163663</a>
              from <span class="vcard"><a class="email" href="mailto:ggaren&#64;apple.com" title="Geoffrey Garen &lt;ggaren&#64;apple.com&gt;"> <span class="fn">Geoffrey Garen</span></a>
</span></b>
        <pre><span class="quote">&gt; Does it work if you write your code this way:
&gt; 
&gt; function decToZero(n) {
&gt;   if (n&gt;0)
&gt;     return decToZero(n-1);
&gt;   return n;
&gt; }</span >

decToZero#DYBUcA:[0x104588310-&gt;0x1045a37c0, NoneFunctionCall, 43]: 43 m_instructions; 344 bytes; 2 parameter(s); 16 callee register(s); 6 variable(s); scope at loc3
[   0] enter             
[   1] get_scope         loc3
[   3] mov               loc4, loc3
[   6] jngreater         arg1, Int32: 0(const0), 35(-&gt;41)
[  10] resolve_scope     loc10, loc3, decToZero(&#64;id0), &lt;GlobalVar&gt;, 1, 0x1045dc0a0
[  17] get_from_scope    loc6, loc10, decToZero(&#64;id0), 2049&lt;ThrowIfNotFound|GlobalVar|NotInitialization&gt;, 60435336    predicting None
[  25] sub               loc9, arg1, Int32: 1(const1)    results: Result:&lt;Int32&gt; LHS ObservedType:&lt;&gt; RHS ObservedType:&lt;&gt; LHS ResultType:&lt;0x3e&gt; RHS ResultType:&lt;0x3&gt;
[  30] call              loc6, loc6, 2, 16 (this at loc10) status(Could Take Slow Path)    Original; predicting None
[  39] ret               loc6
[  41] ret               arg1

Identifiers:
  id0 = decToZero

Constants:
   k0 = Int32: 0: in source as integer
   k1 = Int32: 1: in source as integer

--&gt; RangeError: Maximum call stack size exceeded.</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>