From b7fbe0910cddf984426505de51200ed263d834d8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 9 Apr 2016 10:04:32 -0700 Subject: fix asm2wasm udivmoddi4 optimization when there is no getTempRet0 --- src/asm2wasm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index a3cbb95c7..1d3723869 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -756,10 +756,10 @@ void Asm2WasmBuilder::processAsm(Ref ast) { wasm.memory.exportName = MEMORY; - if (udivmoddi4.is()) { + if (udivmoddi4.is() && getTempRet0.is()) { // generate a wasm-optimized __udivmoddi4 method, which we can do much more efficiently in wasm - assert(getTempRet0.is()); - // first, figure out which minified global is tempRet0 + // we can only do this if we know getTempRet0 as well since we use it to figure out which minified global is tempRet0 + // (getTempRet0 might be an import, if this is a shared module, so we can't optimize that case) int tempRet0; { Expression* curr = wasm.getFunction(getTempRet0)->body; -- cgit v1.2.3