summaryrefslogtreecommitdiff
path: root/src/asm2wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r--src/asm2wasm.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index 87fd10649..8c8e5855a 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -1488,7 +1488,11 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
if (ret->value->type == f64) {
ret->op = DemoteFloat64;
} else if (ret->value->type == i32) {
- ret->op = ConvertSInt32ToFloat32;
+ if (isUnsignedCoercion(ast[2][0])) {
+ ret->op = ConvertUInt32ToFloat32;
+ } else {
+ ret->op = ConvertSInt32ToFloat32;
+ }
} else if (ret->value->type == f32) {
return ret->value;
} else if (ret->value->type == none) { // call, etc.