Commit 2cd66cab authored by ivica.bogosavljevic's avatar ivica.bogosavljevic Committed by Commit bot

Fix failure in RunWasmInterpreted_LoadMemI32_const_oob_misaligned on...

Fix failure in RunWasmInterpreted_LoadMemI32_const_oob_misaligned on architecures that don't support unaligned access

BUG=cctest/test-run-wasm/RunWasmInterpreted_LoadMemI32_const_oob_misaligned

Review-Url: https://codereview.chromium.org/2026553002
Cr-Commit-Position: refs/heads/master@{#36590}
parent 5ed2cf1b
......@@ -1447,8 +1447,7 @@ class ThreadImpl : public WasmInterpreter::Thread {
return DoTrap(kTrapMemOutOfBounds, pc); \
} \
byte* addr = instance()->mem_start + operand.offset + index; \
/* TODO(titzer): alignment, endianness for load mem */ \
WasmVal result(static_cast<ctype>(*reinterpret_cast<mtype*>(addr))); \
WasmVal result(static_cast<ctype>(ReadUnalignedValue<mtype>(addr))); \
Push(pc, result); \
len = 1 + operand.length; \
break; \
......@@ -1481,8 +1480,7 @@ class ThreadImpl : public WasmInterpreter::Thread {
return DoTrap(kTrapMemOutOfBounds, pc); \
} \
byte* addr = instance()->mem_start + operand.offset + index; \
/* TODO(titzer): alignment, endianness for store mem */ \
*reinterpret_cast<mtype*>(addr) = static_cast<mtype>(val.to<ctype>()); \
WriteUnalignedValue<mtype>(addr, static_cast<mtype>(val.to<ctype>())); \
Push(pc, val); \
len = 1 + operand.length; \
break; \
......
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