[Webkit-unassigned] [Bug 161534] Regression(r197648): JSObject::setPrototypeWithCycleCheck() allows for cycles but the rest of the code base does not

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 2 15:52:42 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=161534

--- Comment #4 from Saam Barati <sbarati at apple.com> ---
(In reply to comment #3)
> (In reply to comment #2)
> > > Yeah, we should teach the rest of the engine that it's OK to have cycles
> > > in the "getPrototypeDirect" chain.
> > > Currently, inside JSC itself, this will never happen. However, I guess we
> > > need to
> > > teach it this w.r.t the HTML spec.
> > 
> > That's a pretty big change. Are we sure we need to allow cycles? What's the
> > expected behavior if you find a cycle? Is it specified?
> 
> Note that even without my patch, it is fairly trivial to end up with an
> infinite loop since r197648 allows for cycles:
> 
> <script>
> var target = {
>   __proto__: null
> };
> var proxy = new Proxy(target, {});
> Object.prototype.__proto__ = {
>    __proto__: proxy,
> };
> 
> var a = {};
> a.test;
> </script>
> 
> This seems to infinite loop for me on ToT, no DOM involved.

I believe the bug here is having ProxyObject's structure's prototype field
be Object.prototype. That's wrong.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160902/0485339b/attachment-0001.html>


More information about the webkit-unassigned mailing list