summaryrefslogtreecommitdiff
path: root/src/asm2wasm.cpp
diff options
context:
space:
mode:
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>();
}