Closed
Bug 854396
Opened 12 years ago
Closed 12 years ago
[OdinMonkey] Unsigned conversion is lost when passing to external functions
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: jlong, Assigned: luke)
Details
Attachments
(2 files)
436 bytes,
text/plain
|
Details | |
2.29 KB,
patch
|
sstangl
:
review+
akeybl
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
I might be missing something, but when using asm.js I would expect to see 4294967295 and not -1 in the attached test case. It appears the the unsigned conversion (-1 >>> 0) is lost if it's passed directly to an external function. It works fine if you assign it to a variable first.
Updated•12 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Summary: [asm.js] Unsigned conversion is lost when passing to external functions → [OdinMonkey] Unsigned conversion is lost when passing to external functions
Assignee | ||
Comment 1•12 years ago
|
||
Great find! The problem here is that we're unconditionally treating int arguments as signed. I'm actually surprised that this works if you assign to a variable first; that shouldn't work any different. E.g.: function g() { var i = 4294967295; foo(i >>> 0); } prints -1 for me (incorrectly). Perhaps you were accidentally generating non-validating asm.js (thereby avoiding Odin and the bug)? Anyhow, we'll get this fixed.
Reporter | ||
Comment 2•12 years ago
|
||
Oh, yes, I think you're right. I must have done `var x = -1 >>> 0` which is invalid, so it wasn't running under asm.js. Thanks for confirming!
Assignee | ||
Comment 3•12 years ago
|
||
Right now, you can only return 'signed' and 'double', so, after talking with Alon and Dave, I think we should just apply the symmetric rule to arguments and remove 'unsigned' as a subtype of 'extern'.
Assignee | ||
Comment 4•12 years ago
|
||
Updated•12 years ago
|
Attachment #731986 -
Flags: review?(sstangl) → review+
Assignee | ||
Comment 5•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/0a1e54662a84
Comment 6•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/0a1e54662a84
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Assignee | ||
Comment 7•12 years ago
|
||
Comment on attachment 731986 [details] [diff] [review] disallow in validation rules and test [Approval Request Comment] Bug caused by (feature/regressing bug #): 840282 User impact if declined: incorrect asm.js evaluation Testing completed (on m-c, etc.): m-c Risk to taking this patch (and alternatives if risky): very low
Attachment #731986 -
Flags: approval-mozilla-aurora?
Comment 8•12 years ago
|
||
Comment on attachment 731986 [details] [diff] [review] disallow in validation rules and test Given the risk evaluation and targeted asm.js support in 22, approving.
Attachment #731986 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 9•12 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/1a2ac4c2639c
status-firefox22:
--- → fixed
status-firefox23:
--- → fixed
Comment 10•11 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #3) > Right now, you can only return 'signed' and 'double', so, after talking with > Alon and Dave, I think we should just apply the symmetric rule to arguments > and remove 'unsigned' as a subtype of 'extern'. Filed https://github.com/dherman/asm.js/issues/56 for making a corresponding change to the spec.
You need to log in
before you can comment on or make changes to this bug.
Description
•