diff options
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r-- | src/wasm-validator.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h index 066ab57da..90930d8f4 100644 --- a/src/wasm-validator.h +++ b/src/wasm-validator.h @@ -260,6 +260,11 @@ public: } } + void visitGlobal(Global* curr) { + shouldBeTrue(curr->init->is<Const>(), curr->name, "global init must be valid"); + shouldBeEqual(curr->type, curr->init->type, curr, "global init must have correct type"); + } + void visitFunction(Function *curr) { // if function has no result, it is ignored // if body is unreachable, it might be e.g. a return |