summaryrefslogtreecommitdiff
path: root/src/asm2wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r--src/asm2wasm.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index 8c8e5855a..6455fbf08 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -1228,8 +1228,14 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
conv->value = ret->value;
conv->type = WasmType::f32;
ret->value = conv;
+ } else if (ret->valueType == f64 && ret->value->type == f32) {
+ auto conv = allocator.alloc<Unary>();
+ conv->op = PromoteFloat32;
+ conv->value = ret->value;
+ conv->type = WasmType::f64;
+ ret->value = conv;
} else {
- abort_on("bad subtract types", ast);
+ abort_on("bad sub[] types", ast);
}
}
return ret;