Last Comment Bug 761439 - nativeCall on non-cross-compartment wrappers leads to infinite recursion
: nativeCall on non-cross-compartment wrappers leads to infinite recursion
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla16
Assigned To: Luke Wagner [:luke]
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on: 770407
Blocks: 758912 761462
  Show dependency treegraph
 
Reported: 2012-06-04 16:33 PDT by Luke Wagner [:luke]
Modified: 2012-07-03 12:55 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix and test (1.81 KB, patch)
2012-06-04 16:35 PDT, Luke Wagner [:luke]
sphink: review+
Details | Diff | Splinter Review

Description Luke Wagner [:luke] 2012-06-04 16:33:37 PDT
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.
Comment 1 Luke Wagner [:luke] 2012-06-04 16:35:45 PDT
Created attachment 629991 [details] [diff] [review]
fix and test
Comment 2 Steve Fink [:sfink] [:s:] 2012-06-05 12:12:47 PDT
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.
Comment 3 Luke Wagner [:luke] 2012-06-05 12:45:31 PDT
(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 :)
Comment 5 Steve Fink [:sfink] [:s:] 2012-06-05 16:42:42 PDT
(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).
Comment 6 Luke Wagner [:luke] 2012-06-05 16:44:51 PDT
Ohh, hah, I see.
Comment 7 Ed Morley [:emorley] 2012-06-06 08:29:43 PDT
https://hg.mozilla.org/mozilla-central/rev/807490eb9bbd

Note You need to log in before you can comment on or make changes to this bug.