Bug 184749 - Int8Array.prototype sets value to invalid position
Summary: Int8Array.prototype sets value to invalid position
Status: RESOLVED DUPLICATE of bug 217854
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-18 12:55 PDT by isol2
Modified: 2020-10-16 16:20 PDT (History)
14 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description isol2 2018-04-18 12:55:48 PDT
Hi everyone,

I found a case of inconsistency when try to access an item in invalid position using Int8Array and Uint8Array (same behaviour appears using Int16Array/Uint16Array and Int32Array/Uint32Array).

Tag: 606.1.9.4
OS: ubuntu 16.04 x86

================
Reproduce steps:
- Run this code:
    Int8Array.prototype[10] = 999;
    var a = new Int8Array(5);
    if(!(a[10] === undefined)) throw new Error("Test failed");

Expected results:
pass without errors

Actual results:
Error: Test failed
================

V8, chakra and spidermonkey has passed on this testcase. It was observed that a[10] is 999 (the others engines is undefined), but if we change for "var a = new Int8Array(20)", a[10] is 0 (same occurs with all others engines).
Comment 1 Radar WebKit Bug Importer 2018-04-20 23:43:12 PDT
<rdar://problem/39618641>
Comment 2 isol2 2018-08-23 18:02:02 PDT
cinfuzz
Comment 3 Ross Kirsling 2020-10-16 16:20:15 PDT
This will be fixed as part of bug 217854.

*** This bug has been marked as a duplicate of bug 217854 ***