diff options
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> { |