From 65db7e5e8f3994a7d4ca1b4e01f87eef13c7c87b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 17 Nov 2015 20:35:29 -0800 Subject: handle + as a float-to-double conversion --- src/asm2wasm.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index a81f4af68..08f4e4141 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -773,6 +773,13 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { ret->type = WasmType::f64; return ret; } + if (childType == ASM_FLOAT) { + auto ret = allocator.alloc(); + ret->op = PromoteFloat32; + ret->value = process(ast[2]); + ret->type = WasmType::f64; + return ret; + } assert(childType == ASM_NONE || childType == ASM_DOUBLE); // e.g. a coercion on a call or for a return auto ret = process(ast[2]); // just look through the +() coercion ret->type = WasmType::f64; // we add it here for e.g. call coercions -- cgit v1.2.3