Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: src/wasm/wasm-interpreter.cc

Issue 2026553002: Fix failure in RunWasmInterpreted_LoadMemI32_const_oob_misaligned on architecures that don't suppor… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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; \
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698