summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 52082f3a8..ca396fd24 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -432,6 +432,12 @@ public:
if (ifFalse) printFullLine(o, indent, ifFalse);
return decIndent(o, indent);
}
+
+ void finalize() {
+ if (condition) {
+ type = getReachableWasmType(ifTrue->type, ifFalse->type);
+ }
+ }
};
class Loop : public Expression {
@@ -892,8 +898,7 @@ public:
}
void finalize() {
- type = ifTrue->type;
- if (type == none) type = ifFalse->type; // ifTrue might be unreachable
+ type = getReachableWasmType(ifTrue->type, ifFalse->type);
}
};