summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
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");