From 0c4e4521b5ede340a7060bf052ccdf84269c3f0a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 3 Feb 2016 12:20:59 -0800 Subject: Break and Return have unreachable type --- src/wasm-binary.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/wasm-binary.h') diff --git a/src/wasm-binary.h b/src/wasm-binary.h index de4747d84..440689ea0 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -851,7 +851,7 @@ assert(0); void visitBinary(Binary *curr) { if (debug) std::cerr << "zz node: Binary" << std::endl; #define TYPED_CODE(code) { \ - switch (curr->left->type) { \ + switch (getReachableWasmType(curr->left->type, curr->right->type)) { \ case i32: o << int8_t(BinaryConsts::I32##code); break; \ case i64: o << int8_t(BinaryConsts::I64##code); break; \ case f32: o << int8_t(BinaryConsts::F32##code); break; \ @@ -861,7 +861,7 @@ assert(0); break; \ } #define INT_TYPED_CODE(code) { \ - switch (curr->left->type) { \ + switch (getReachableWasmType(curr->left->type, curr->right->type)) { \ case i32: o << int8_t(BinaryConsts::I32##code); break; \ case i64: o << int8_t(BinaryConsts::I64##code); break; \ default: abort(); \ @@ -869,7 +869,7 @@ assert(0); break; \ } #define FLOAT_TYPED_CODE(code) { \ - switch (curr->left->type) { \ + switch (getReachableWasmType(curr->left->type, curr->right->type)) { \ case f32: o << int8_t(BinaryConsts::F32##code); break; \ case f64: o << int8_t(BinaryConsts::F64##code); break; \ default: abort(); \ -- cgit v1.2.3