-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSC should throw an exception when BigUint64Array copy value from Int…
…32Array https://bugs.webkit.org/show_bug.cgi?id=263954 rdar://117816146 Reviewed by Yusuke Suzuki. BigInt array set for non-BigInt typed array should throw exceptions. So, we shouldn't copy non-BigInt values from other typed array to BigInt for TypedArray.prototype.set. * JSTests/stress/bigint-array-set.js: Added. (i.catch): * Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h: (JSC::JSGenericTypedArrayView<Adaptor>::copyFromInt32ShapeArray): (JSC::JSGenericTypedArrayView<Adaptor>::copyFromDoubleShapeArray): (JSC::JSGenericTypedArrayView<Adaptor>::setFromArrayLike): Canonical link: https://commits.webkit.org/270133@main
- Loading branch information
Showing
2 changed files
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//@ runDefault("--jitPolicyScale=0") | ||
for (let i = 1; i < 1e3; i++) { | ||
const v2 = [1000]; | ||
const v4 = new BigUint64Array(i); | ||
let thrown = false; | ||
try { | ||
v4.set(v2); | ||
} catch (e6) { | ||
thrown = true; | ||
} | ||
if (!thrown) | ||
throw new Error("bad"); | ||
Object.defineProperty(v2, 10, { writable: true, value: 10 }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters