summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-02-03 12:20:59 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-02-03 12:20:59 -0800
commit0c4e4521b5ede340a7060bf052ccdf84269c3f0a (patch)
tree3698cca698bbb8dfb044a4c8625a7b5c06f68e48 /src/wasm.h
parent83b368381eb1e9e499f213129627d0c188d0008f (diff)
downloadbinaryen-0c4e4521b5ede340a7060bf052ccdf84269c3f0a.tar.gz
binaryen-0c4e4521b5ede340a7060bf052ccdf84269c3f0a.tar.bz2
binaryen-0c4e4521b5ede340a7060bf052ccdf84269c3f0a.zip
Break and Return have unreachable type
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 7a792fda4..c030d9d60 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -138,6 +138,10 @@ inline WasmType getReachableWasmType(WasmType a, WasmType b) {
return a != unreachable ? a : b;
}
+inline bool isConcreteWasmType(WasmType type) {
+ return type != none && type != unreachable;
+}
+
// Literals
class Literal {
@@ -497,7 +501,9 @@ public:
class Break : public Expression {
public:
- Break() : Expression(BreakId), condition(nullptr), value(nullptr) {}
+ Break() : Expression(BreakId), condition(nullptr), value(nullptr) {
+ type = unreachable;
+ }
Expression *condition;
Name name;
@@ -926,7 +932,9 @@ class Return : public Expression {
public:
Expression *value;
- Return() : Expression(ReturnId), value(nullptr) {}
+ Return() : Expression(ReturnId), value(nullptr) {
+ type = unreachable;
+ }
std::ostream& doPrint(std::ostream &o, unsigned indent) {
printOpening(o, "return");