Closed
Bug 532454
Opened 16 years ago
Closed 15 years ago
Sort implementation incorrectly converts result of program-supplied comparison function to integer
Categories
(Tamarin Graveyard :: Library, defect, P2)
Tamarin Graveyard
Library
Tracking
(Not tracked)
RESOLVED
FIXED
Q3 11 - Serrano
People
(Reporter: lhansen, Assigned: wmaddox)
Details
(Whiteboard: must-fix-candidate)
Attachments
(1 file)
|
7.94 KB,
patch
|
stejohns
:
review+
|
Details | Diff | Splinter Review |
See ArraySort::ScriptCompare in ArrayClass.cpp: it calls toInteger on the return value from the user function, /even though there is a comment there that says not to do that/. This breaks the obvious user function that subtracts one element from the other.
TC, these should both produce elements in ascending order:
var nonWorkingCompare:Function = function(x:Number, y:Number):Number
{
return x - y;
};
var workingCompare:Function = function(x:Number, y:Number):Number
{
if (x < y) return -1;
if (x > y) return 1;
return 0;
};
trace([5.5, 3.1, 4.9, 4].sort(nonWorkingCompare)); // 3.1,4.9,5.5,4
trace([5.5, 3.1, 4.9, 4].sort(workingCompare)); // 3.1,4,4.9,5.5
Flags: in-testsuite?
Flags: flashplayer-needsversioning+
| Reporter | ||
Updated•16 years ago
|
Component: Virtual Machine → Library
Flags: in-testsuite?
OS: Mac OS X → All
Priority: -- → P2
QA Contact: vm → library
Hardware: x86 → All
Target Milestone: Future → flash10.2
Updated•15 years ago
|
Assignee: nobody → wmaddox
| Reporter | ||
Comment 1•15 years ago
|
||
Broken for both Array and Vector. Also came in via https://bugs.adobe.com/jira/browse/ASL-174.
Status: NEW → ASSIGNED
Updated•15 years ago
|
Flags: flashplayer-bug+
Whiteboard: must–fix-candidate
Updated•15 years ago
|
Whiteboard: must–fix-candidate → must-fix-candidate
| Assignee | ||
Comment 2•15 years ago
|
||
Fix follows the pattern set by a disturbingly similar issue previously fixed, bug 524122.
| Assignee | ||
Updated•15 years ago
|
Attachment #527900 -
Flags: review?(stejohns)
Comment 3•15 years ago
|
||
Comment on attachment 527900 [details] [diff] [review]
Versioned fix
Review of attachment 527900 [details] [diff] [review]:
Looks right.
Attachment #527900 -
Flags: review?(stejohns) → review+
| Assignee | ||
Comment 4•15 years ago
|
||
Pushed to TR:
http://hg.mozilla.org/tamarin-redux/rev/357bda124e63
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•