diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-20 11:21:47 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-20 11:21:47 -0700 |
commit | b28a3a6eba4c4fbe64333dd544977a0c4f37c650 (patch) | |
tree | 0919805194011cc453e7074030dc15c1342f67c3 /src/wasm.h | |
parent | 244da920eedafec42da4e91b83c09d0021a36a7f (diff) | |
parent | a2f3fbdc80b72fcf04a789e723de7f5561387dcc (diff) | |
download | binaryen-b28a3a6eba4c4fbe64333dd544977a0c4f37c650.tar.gz binaryen-b28a3a6eba4c4fbe64333dd544977a0c4f37c650.tar.bz2 binaryen-b28a3a6eba4c4fbe64333dd544977a0c4f37c650.zip |
Merge pull request #531 from WebAssembly/fixes
Type checking fixes
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> { |