nativeCall on non-cross-compartment wrappers leads to infinite recursion

RESOLVED FIXED in mozilla16

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: luke, Assigned: luke)

Tracking

unspecified
mozilla16
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
The reason is that IndirectProxyHandler::nativeCall just makes the same call.  Since we have recursion checks on this path, the bug just manifests itself as a recursion error instead of a type error when you do, e.g., Data.prototype.getTime.all(window.location).  Simple fix, though.
(Assignee)

Comment 1

5 years ago
Created attachment 629991 [details] [diff] [review]
fix and test
Attachment #629991 - Flags: review?(sphink)
Blocks: 758912
Blocks: 761462
I'm going to guess your example test case was meant to be

  Date.prototype.getTime.apply(window.location)

In the shell, wrap(new Date).getTime() works too.
Attachment #629991 - Flags: review?(sphink) → review+
(Assignee)

Comment 3

5 years ago
(In reply to Steve Fink [:sfink] from comment #2)
> I'm going to guess your example test case was meant to be

Well, any non-generic method exercises the path.  I picked DataView since window.location isn't in the shell and Data tends to give temporal values :)
(Assignee)

Comment 4

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/807490eb9bbd
Target Milestone: --- → mozilla16
(In reply to Luke Wagner [:luke] from comment #3)
> (In reply to Steve Fink [:sfink] from comment #2)
> > I'm going to guess your example test case was meant to be
> 
> Well, any non-generic method exercises the path.  I picked DataView since
> window.location isn't in the shell and Data tends to give temporal values :)

I was referring to comment 0, which confused me briefly (Data, all).
(Assignee)

Comment 6

5 years ago
Ohh, hah, I see.

Comment 7

5 years ago
https://hg.mozilla.org/mozilla-central/rev/807490eb9bbd
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Updated

5 years ago
Depends on: 770407
You need to log in before you can comment on or make changes to this bug.