summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-05-20 10:38:48 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-05-20 10:38:48 -0700
commite9c7c20ef84fc5a66823b9fa871f54f98a8a714a (patch)
tree1b5d9b297557c01483f2d9d9503597335e420052 /src/wasm.h
parentfe93b86e0e1dd470c3508fa2ef9f3affbf18b146 (diff)
downloadbinaryen-e9c7c20ef84fc5a66823b9fa871f54f98a8a714a.tar.gz
binaryen-e9c7c20ef84fc5a66823b9fa871f54f98a8a714a.tar.bz2
binaryen-e9c7c20ef84fc5a66823b9fa871f54f98a8a714a.zip
type check loop output type properly
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wasm.h b/src/wasm.h
index fc0337700..839dcf3c2 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -974,9 +974,13 @@ public:
Name out, in;
Expression *body;
- void finalize() {
- type = body->type; // loop might have a type, if the body ends in something that does not break
+ // set the type of a loop if you already know it
+ void finalize(WasmType type_) {
+ type = type_;
}
+
+ // set the type of a loop based on its contents. this scans the loop, so it is not fast
+ void finalize();
};
class Break : public SpecificExpression<Expression::BreakId> {