Closed
Bug 654536
Opened 14 years ago
Closed 14 years ago
TI+JM: incorrect result with function.call
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(1 file)
1.51 KB,
patch
|
bhackett1024
:
review+
|
Details | Diff | Splinter Review |
--
function f() {
var x = Object.prototype.hasOwnProperty.call(1);
assertEq(x, false);
isNaN(2);
}
f();
--
$ ./js -n -m -a test.js
test.js:3: Error: Assertion failed: got function call() {[native code]}, expected false
Revision 3147f81224c8, 32-bit OS X.
Assignee | ||
Comment 1•14 years ago
|
||
The hasOwnProperty.call(1) triggers recompilation of f (initialization of Number). We need to use the special rejoin path also for ic::NativeCall to load the return value correctly in case of lowered call/apply and a native function.
Assignee: general → jandemooij
Status: NEW → ASSIGNED
Attachment #530373 -
Flags: review?(bhackett1024)
Comment 2•14 years ago
|
||
Comment on attachment 530373 [details] [diff] [review]
Patch
I think that NativeCall/New need to have the same ABI as Call/New: return the code pointer to jump to or NULL (in this case, always NULL), so after the rejoin we don't interpret the maybe random value of eax as the return code pointer. r+ with that fixed.
Attachment #530373 -
Flags: review?(bhackett1024) → review+
Comment 3•14 years ago
|
||
Comment on attachment 530373 [details] [diff] [review]
Patch
I think that NativeCall/New need to have the same ABI as Call/New: return the code pointer to jump to or NULL (in this case, always NULL), so after the rejoin we don't interpret the maybe random value of eax as the return code pointer. r+ with that fixed.
Comment 4•14 years ago
|
||
Comment on attachment 530373 [details] [diff] [review]
Patch
I think that NativeCall/New need to have the same ABI as Call/New: return the code pointer to jump to or NULL (in this case, always NULL), so after the rejoin we don't interpret the maybe random value of eax as the return code pointer. r+ with that fixed.
Comment 5•14 years ago
|
||
Comment on attachment 530373 [details] [diff] [review]
Patch
I think that NativeCall/New need to have the same ABI as Call/New: return the code pointer to jump to or NULL (in this case, always NULL), so after the rejoin we don't interpret the maybe random value of eax as the return code pointer. r+ with that fixed.
Comment 6•14 years ago
|
||
Hilarious.
Assignee | ||
Comment 7•14 years ago
|
||
Oops that was embarrassing, shouldn't submit patches when I'm in a hurry.
http://hg.mozilla.org/projects/jaegermonkey/rev/8436c7bca2e9
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•