Commit be5738a8 authored by Milad Fa's avatar Milad Fa Committed by Commit Bot

[wasm][memory64] Fix endianness issue on Load cctest

`0x12345678` will be written to memory in the same order on BE
machines however, as Wasm is LE enforced, a memory load will
force a byte reverse operation on BE machines which changes the value.

To fix the problem, we write the reversed value to memory.

Change-Id: I0d562768d5cef823cb918ed1b57a2a41e404ffc6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2622927
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72041}
parent 9a6a2287
......@@ -34,7 +34,11 @@ WASM_EXEC_TEST(Load) {
CHECK_EQ(0, r.Call(0));
#if V8_TARGET_BIG_ENDIAN
memory[0] = 0x78563412;
#else
memory[0] = 0x12345678;
#endif
CHECK_EQ(0x12345678, r.Call(0));
CHECK_EQ(0x123456, r.Call(1));
CHECK_EQ(0x1234, r.Call(2));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment