summaryrefslogtreecommitdiff
path: root/src/wasm-validator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r--src/wasm-validator.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index af0c4ba9d..46bcf7a2e 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -39,19 +39,6 @@ public:
void visitLoop(Loop *curr) override {
if (curr->in.is()) {
- // the "in" label has a none type, since no one can receive its value. make sure no one breaks to it with a value.
- struct ChildChecker : public WasmWalker {
- Name in;
- bool valid = true;
-
- ChildChecker(Name in) : in(in) {}
-
- void visitBreak(Break *curr) override {
- if (curr->name == in && curr->value) {
- valid = false;
- }
- }
- };
ChildChecker childChecker(curr->in);
childChecker.walk(curr->body);
shouldBeTrue(childChecker.valid);
@@ -109,6 +96,21 @@ public:
}
private:
+
+ // the "in" label has a none type, since no one can receive its value. make sure no one breaks to it with a value.
+ struct ChildChecker : public WasmWalker {
+ Name in;
+ bool valid = true;
+
+ ChildChecker(Name in) : in(in) {}
+
+ void visitBreak(Break *curr) override {
+ if (curr->name == in && curr->value) {
+ valid = false;
+ }
+ }
+ };
+
// helpers
void shouldBeTrue(bool result) {