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}
This commit is contained in:
parent
5ed2cf1b65
commit
2cd66cabd6
@ -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; \
|
||||
|
Loading…
Reference in New Issue
Block a user