From b17e84b491a309c9f15e7a502f115ece19404b11 Mon Sep 17 00:00:00 2001 From: juj Date: Tue, 25 Feb 2020 09:59:45 +0200 Subject: Fix to https://github.com/WebAssembly/binaryen/issues/2170 (#2654) * Fix to https://github.com/WebAssembly/binaryen/issues/2170 * Adjust fix * clang-format --- src/asm2wasm.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/asm2wasm.h') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 33e84bc33..95a5ba481 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -3252,6 +3252,12 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { ptr[3]->isNumber() && ptr[3]->getInteger() == 0)) { return process(ptr[2]); } + // If there is no shift at all, process the variable directly + // E.g. the address variable "$4" in Atomics_compareExchange(HEAP8, $4, $7, + // $8); + if (ptr->isString()) { + return process(ptr); + } // Otherwise do the same as processUnshifted. return processUnshifted(ptr, bytes); }; -- cgit v1.2.3