diff options
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r-- | src/asm2wasm.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 394b3de9f..ac9732e68 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -965,11 +965,16 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { ret->type = WasmType::i32; return ret; } - assert(asmType == ASM_DOUBLE); auto ret = allocator.alloc<Unary>(); ret->op = Neg; ret->value = process(ast[2]); - ret->type = WasmType::f64; + if (asmType == ASM_DOUBLE) { + ret->type = WasmType::f64; + } else if (asmType == ASM_FLOAT) { + ret->type = WasmType::f32; + } else { + abort(); + } return ret; } else if (ast[1] == B_NOT) { // ~, might be ~~ as a coercion or just a not |