From 04440d28693474cf0a7c10c5a63915528a227a5f Mon Sep 17 00:00:00 2001 From: rayb Date: Wed, 22 Mar 2017 10:48:24 -0700 Subject: [PATCH] [wasm] Fix wasm interpreter entry for 32 bit big endian systems The order of the return values are wrong for 32 bit big endian machines. BUG=none R=titzer@chromium.org, clemensh@chromium.org, Review-Url: https://codereview.chromium.org/2764583003 Cr-Commit-Position: refs/heads/master@{#44041} --- src/compiler/wasm-compiler.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc index 7fb4bc358f..e28c916f35 100644 --- a/src/compiler/wasm-compiler.cc +++ b/src/compiler/wasm-compiler.cc @@ -2820,10 +2820,12 @@ void WasmGraphBuilder::BuildWasmInterpreterEntry( MachineType load_rep = wasm::WasmOpcodes::MachineTypeFor(wasm::kWasmI32); Node* lower = graph()->NewNode(jsgraph()->machine()->Load(load_rep), arg_buffer, - Int32Constant(0), *effect_, *control_); + Int32Constant(kInt64LowerHalfMemoryOffset), *effect_, + *control_); Node* upper = graph()->NewNode(jsgraph()->machine()->Load(load_rep), arg_buffer, - Int32Constant(sizeof(int32_t)), lower, *control_); + Int32Constant(kInt64UpperHalfMemoryOffset), lower, + *control_); *effect_ = upper; Return(lower, upper); } else {