diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-21 22:10:43 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-21 22:11:54 -0800 |
commit | 14ad84c09bd93958cc8fcfa4a38bbcc7e7267169 (patch) | |
tree | e37f269a60220a6a5908e700067966d643ef1e7c /src | |
parent | c750ead5ac06a906d17756ca41420d4ca649f84d (diff) | |
download | binaryen-14ad84c09bd93958cc8fcfa4a38bbcc7e7267169.tar.gz binaryen-14ad84c09bd93958cc8fcfa4a38bbcc7e7267169.tar.bz2 binaryen-14ad84c09bd93958cc8fcfa4a38bbcc7e7267169.zip |
handle -f32
Diffstat (limited to 'src')
-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 |