Closed
Bug 894781
Opened 12 years ago
Closed 12 years ago
OdinMonkey: Incorrect float abs
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla25
People
(Reporter: jruderman, Assigned: bbouvier)
References
Details
(Keywords: regression, testcase)
Attachments
(1 file)
1.33 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
function m(stdlib)
{
"use asm";
var abs = stdlib.Math.abs;
function f(d)
{
d = +d;
return (~~(5.0 - +abs(d)))|0;
}
return f;
}
var f = m(this);
assertEq(f(0.2), 4); // got 5, expected 4
assertEq(f(NaN), 0); // got 5, expected 0
The first bad revision is:
changeset: http://hg.mozilla.org/mozilla-central/rev/21154eef33ac
user: Benjamin Bouvier
date: Mon Jul 15 14:46:03 2013 -0700
summary: Bug 893368: in asm.js, correctly compute range for truncated Math.abs calls; r=nbp
Comment 1•12 years ago
|
||
The only reason why this patch might be the cause is that there is another bug which set MAbs' implicitTruncate_ flag in such case.
Assignee | ||
Comment 2•12 years ago
|
||
We definitely don't want to truncate double values.
Luke, what do you think of putting all range analysis test cases in a single testRangeAnalysis file? It would avoid test files proliferation in tests/asm.js.
![]() |
||
Comment 3•12 years ago
|
||
Comment on attachment 777251 [details] [diff] [review]
fix + test case
Looks good and testRangeAnalysis also sounds good.
Attachment #777251 -
Flags: review?(luke) → review+
Assignee | ||
Comment 4•12 years ago
|
||
Comment 5•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in
before you can comment on or make changes to this bug.
Description
•