diff options
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r-- | src/asm2wasm.h | 6 |
1 files changed, 3 insertions, 3 deletions
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; |