summaryrefslogtreecommitdiff
path: root/src/asm2wasm.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-10-29 21:39:05 -0700
committerAlon Zakai <alonzakai@gmail.com>2015-10-29 21:39:05 -0700
commit86626450d7bc165be94efb004e9e3699074777a4 (patch)
tree3465f4907d9816eb9dc6292d82cf3cbe94223950 /src/asm2wasm.cpp
parent0b866305ecee485ec5ef2a314fe79ac2df52b21a (diff)
downloadbinaryen-86626450d7bc165be94efb004e9e3699074777a4.tar.gz
binaryen-86626450d7bc165be94efb004e9e3699074777a4.tar.bz2
binaryen-86626450d7bc165be94efb004e9e3699074777a4.zip
nop imports; all tests pass
Diffstat (limited to 'src/asm2wasm.cpp')
-rw-r--r--src/asm2wasm.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/asm2wasm.cpp b/src/asm2wasm.cpp
index 50f504c6a..6e597ab94 100644
--- a/src/asm2wasm.cpp
+++ b/src/asm2wasm.cpp
@@ -911,8 +911,16 @@ Function* Asm2WasmModule::processFunction(Ref ast) {
}
Call* ret;
if (imports.find(name) != imports.end()) {
+ // no imports yet in reference interpreter, fake it
+ AsmType asmType = detectType(astStackHelper.getParent(), &asmData);
+ if (asmType == ASM_NONE) return allocator.alloc<Nop>();
+ if (asmType == ASM_INT) return allocator.alloc<Const>()->set(Literal((int32_t)0));
+ if (asmType == ASM_DOUBLE) return allocator.alloc<Const>()->set(Literal((double)0.0));
+ abort();
+#if 0
ret = allocator.alloc<CallImport>();
noteImportedFunctionCall(ast, astStackHelper.getParent(), &asmData);
+#endif
} else {
ret = allocator.alloc<Call>();
}