Skip to content

Commit 06a64da

Browse files
Milad FaV8 LUCI CQ
authored andcommitted
Fix regress-crbug-1520311 on big endian
DataView is used to make sure values are written and read back correctly on BE platforms. Change-Id: I23984e0c0b65114e7027c30726080dd40cd4cbce Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5234515 Commit-Queue: Milad Farazmand <mfarazma@redhat.com> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/main@{#91992}
1 parent 325c326 commit 06a64da

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/mjsunit/regress/wasm/regress-crbug-1520311.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ let instance = builder.instantiate();
2828
const kStoreIndex = 1;
2929
instance.exports.store(kStoreIndex);
3030

31-
let i64 = new BigInt64Array(instance.exports.memory.buffer);
31+
let i64 = new DataView(instance.exports.memory.buffer);
3232

33-
assertEquals(0n, i64[0]);
34-
assertEquals(42n, i64[kStoreIndex]);
33+
assertEquals(0n, i64.getBigInt64(0, true));
34+
assertEquals(42n, i64.getBigInt64(kStoreIndex * 8, true));
3535

3636
const kLoadIndex = 10;
3737
const kLoadValue = 1234n;
38-
i64[kLoadIndex] = kLoadValue;
38+
i64.setBigInt64(kLoadIndex * 8, kLoadValue, true);
3939
let load = instance.exports.load;
4040
assertEquals(0n, load(kLoadIndex * 8));
4141
assertEquals(kLoadValue, load(kLoadIndex));

0 commit comments

Comments
 (0)