diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-20 10:38:48 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-20 10:38:48 -0700 |
commit | e9c7c20ef84fc5a66823b9fa871f54f98a8a714a (patch) | |
tree | 1b5d9b297557c01483f2d9d9503597335e420052 /src/wasm.h | |
parent | fe93b86e0e1dd470c3508fa2ef9f3affbf18b146 (diff) | |
download | binaryen-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.h | 8 |
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> { |