<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Regression(r197648): JSObject::setPrototypeWithCycleCheck() allows for cycles but the rest of the code base does not"
   href="https://bugs.webkit.org/show_bug.cgi?id=161534#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Regression(r197648): JSObject::setPrototypeWithCycleCheck() allows for cycles but the rest of the code base does not"
   href="https://bugs.webkit.org/show_bug.cgi?id=161534">bug 161534</a>
              from <span class="vcard"><a class="email" href="mailto:sbarati&#64;apple.com" title="Saam Barati &lt;sbarati&#64;apple.com&gt;"> <span class="fn">Saam Barati</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=161534#c0">comment #0</a>)
<span class="quote">&gt; JSObject::setPrototypeWithCycleCheck() allows for cycles but the rest of the
&gt; code base does not deal properly with cycles.
&gt; 
&gt; This is because of the following check that was added:
&gt; if (UNLIKELY(asObject(nextPrototype)-&gt;methodTable(vm)-&gt;getPrototype !=
&gt; defaultGetPrototype)) 
&gt;   break;
&gt; 
&gt; This was added to match the EcmaScript spec:
&gt; - <a href="https://tc39.github.io/ecma262/#sec-ordinarysetprototypeof">https://tc39.github.io/ecma262/#sec-ordinarysetprototypeof</a> (step 8)
&gt; 
&gt; However, if you create a cycles, we end up with an infinite loop later on
&gt; under:
&gt; Structure::anyObjectInChainMayInterceptIndexedAccesses()
&gt; 
&gt; This is likely not the only place we traverse the prototype chain and except
&gt; there is no cycle.
&gt; 
&gt; I noticed this when running
&gt; html/browsers/history/the-location-interface/
&gt; allow_prototype_cycle_through_location.sub.html with the patch for Bug
&gt; 161455 applied.</span >

Yeah, we should teach the rest of the engine that it's OK to have cycles
in the &quot;getPrototypeDirect&quot; chain.
Currently, inside JSC itself, this will never happen. However, I guess we need to
teach it this w.r.t the HTML spec.</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>