Closed Bug 624483 Opened 14 years ago Closed 13 years ago

JM: different output with testcase involving typed arrays, "Infinity"

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- .x+

People

(Reporter: jandem, Assigned: dvander)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

This script:
---
var arr = new Uint8ClampedArray(16);
for (var i = 0; i < 16; i++) {
    arr[i] = "Infinity";
}
assertEq(arr[14], 255);
---
Fails with -m: 
Error: Assertion failed: got 0, expected 255
Blocks: Jaeger
Summary: JM: different output involving typed arrays, "Infinity" → JM: different output with testcase involving typed arrays, "Infinity"
blocking2.0: --- → ?
blocking2.0: ? → .x
Jan, does this fail with non-infinite numbers larger than 255 too?  Issues in Uint8ClampedArray in particular worry me compat-wise, since that's pretty widely used on the web (as canvas imagedata's .data property).
(In reply to comment #1)
> Jan, does this fail with non-infinite numbers larger than 255 too? 

It fails also with "1e12" and "1e15", but not "1e14" and "1e16". And only if they are strings. I tried some random numbers between 255 and 1000 but was unable to reproduce.
FWIW, "2147483648" also fails. I think integers are OK, maybe some smaller doubles also fail, not sure.
Attached patch fixSplinter Review
I investigated this to see if it was sg:critical, it's not but the bug is pretty easy.
Assignee: general → dvander
Status: NEW → ASSIGNED
Attachment #502604 - Flags: review?(vladimir)
Does that patch make ClampIntForUint8Array unused?
Nope, it's still there.
vlad: review ping
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: