summaryrefslogtreecommitdiff
path: root/src/asm2wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-04-09 10:04:32 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-04-09 10:04:32 -0700
commitb7fbe0910cddf984426505de51200ed263d834d8 (patch)
tree02cc33f3ce2e18aac41a5c43869404f08ca585cb /src/asm2wasm.h
parent8efc401621d1794c057bfb43345b6ac4d615b2e0 (diff)
downloadbinaryen-b7fbe0910cddf984426505de51200ed263d834d8.tar.gz
binaryen-b7fbe0910cddf984426505de51200ed263d834d8.tar.bz2
binaryen-b7fbe0910cddf984426505de51200ed263d834d8.zip
fix asm2wasm udivmoddi4 optimization when there is no getTempRet0
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r--src/asm2wasm.h6
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;