Index: src/wasm/wasm-debug.cc |
diff --git a/src/wasm/wasm-debug.cc b/src/wasm/wasm-debug.cc |
index 2c6f8c1d0abaff6043b9552536e5baf54712b3b8..c00a4f1ddd0f6b487ac1bf0502f57fe3ced0026d 100644 |
--- a/src/wasm/wasm-debug.cc |
+++ b/src/wasm/wasm-debug.cc |
@@ -85,11 +85,11 @@ class InterpreterHandle { |
ScopedVector<WasmVal> wasm_args(num_params); |
uint8_t* arg_buf_ptr = arg_buffer; |
for (int i = 0; i < num_params; ++i) { |
- uint32_t param_size = 1 << ElementSizeLog2Of(sig->GetParam(i)); |
+ int param_size = 1 << ElementSizeLog2Of(sig->GetParam(i)); |
#define CASE_ARG_TYPE(type, ctype) \ |
case type: \ |
DCHECK_EQ(param_size, sizeof(ctype)); \ |
- wasm_args[i] = WasmVal(ReadUnalignedValue<ctype>(arg_buf_ptr)); \ |
+ wasm_args[i] = WasmVal(*reinterpret_cast<ctype*>(arg_buf_ptr)); \ |
break; |
switch (sig->GetParam(i)) { |
CASE_ARG_TYPE(kWasmI32, uint32_t) |
@@ -100,7 +100,7 @@ class InterpreterHandle { |
default: |
UNREACHABLE(); |
} |
- arg_buf_ptr += param_size; |
+ arg_buf_ptr += RoundUpToMultipleOfPowOf2(param_size, 8); |
} |
WasmInterpreter::Thread* thread = interpreter_.GetThread(0); |
@@ -143,7 +143,7 @@ class InterpreterHandle { |
#define CASE_RET_TYPE(type, ctype) \ |
case type: \ |
DCHECK_EQ(1 << ElementSizeLog2Of(sig->GetReturn(0)), sizeof(ctype)); \ |
- WriteUnalignedValue<ctype>(arg_buffer, ret_val.to<ctype>()); \ |
+ *reinterpret_cast<ctype*>(arg_buffer) = ret_val.to<ctype>(); \ |
break; |
switch (sig->GetReturn(0)) { |
CASE_RET_TYPE(kWasmI32, uint32_t) |