| Index: src/wasm/wasm-interpreter.cc
|
| diff --git a/src/wasm/wasm-interpreter.cc b/src/wasm/wasm-interpreter.cc
|
| index 23efebfabf7e4abc9c8a3b9d2930f39cc86295f5..95e10097c0b59cda1fe555618a333cf9ff2787ff 100644
|
| --- a/src/wasm/wasm-interpreter.cc
|
| +++ b/src/wasm/wasm-interpreter.cc
|
| @@ -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; \
|
|
|