diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-13 21:27:25 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-13 21:28:55 -0800 |
commit | f08d6fbd7c24dc9dc07081c72869095dab3647ea (patch) | |
tree | da8d75b70d1c809d066a79316cbdbf1d77a30df5 | |
parent | 514a7e8b88b727bfa0871b5df0ba362fa6b529fb (diff) | |
download | binaryen-f08d6fbd7c24dc9dc07081c72869095dab3647ea.tar.gz binaryen-f08d6fbd7c24dc9dc07081c72869095dab3647ea.tar.bz2 binaryen-f08d6fbd7c24dc9dc07081c72869095dab3647ea.zip |
set seq type properly in asm2wasm
-rw-r--r-- | src/asm2wasm.h | 1 | ||||
-rw-r--r-- | test/unit.asm.js | 4 | ||||
-rw-r--r-- | test/unit.wast | 15 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index ce5b669d1..c28d60a75 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -963,6 +963,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { auto ret = allocator.alloc<Block>(); ret->list.push_back(process(ast[1])); ret->list.push_back(process(ast[2])); + ret->type = ret->list[1]->type; return ret; } else if (what == SWITCH) { // XXX switch is still in flux in the spec repo, just emit a placeholder diff --git a/test/unit.asm.js b/test/unit.asm.js index 4b706eb26..db761705c 100644 --- a/test/unit.asm.js +++ b/test/unit.asm.js @@ -41,6 +41,10 @@ function () { d = +(i | 0); d = +(i >>> 0); } + function seq() { + var J = 0.0; + J = (0.1, 5.1) - (3.2, 4.2); + } function z() { } diff --git a/test/unit.wast b/test/unit.wast index 6a33e155b..074804936 100644 --- a/test/unit.wast +++ b/test/unit.wast @@ -151,6 +151,21 @@ ) ) ) + (func $seq + (local $J f64) + (set_local $J + (f64.sub + (block + (f64.const 0.1) + (f64.const 5.1) + ) + (block + (f64.const 3.2) + (f64.const 4.2) + ) + ) + ) + ) (func $z (nop) ) |