diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-04-28 12:55:21 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-04-28 12:55:21 -0700 |
commit | 5c11c30dad7ac608acf9ee6bf473f6407547bca2 (patch) | |
tree | 12b7aac0b6c1dab399012aeb0dc8bffdd9dba525 /src | |
parent | eff3a393493f5ce4c906f50f4b360c3f9ecdf2eb (diff) | |
download | binaryen-5c11c30dad7ac608acf9ee6bf473f6407547bca2.tar.gz binaryen-5c11c30dad7ac608acf9ee6bf473f6407547bca2.tar.bz2 binaryen-5c11c30dad7ac608acf9ee6bf473f6407547bca2.zip |
fix asm2wasm f64->f32->i32 bitcast (#412)
Diffstat (limited to 'src')
-rw-r--r-- | src/asm2wasm.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index f905d2047..974a06bf3 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -1579,6 +1579,10 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { auto conv = allocator.alloc<Unary>(); conv->op = ReinterpretFloat; conv->value = process(writtenValue); + if (conv->value->type == f64) { + // this has an implicit f64->f32 in the write to memory + conv->value = builder.makeUnary(DemoteFloat64, conv->value, f32); + } conv->type = WasmType::i32; return conv; } |