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.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index ad2b7e1a3..28e575ca4 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -407,6 +407,7 @@ public:
void visitGlobal(Global* curr) {
if (!validateGlobally) return;
+ shouldBeTrue(curr->init != nullptr, curr->name, "global init must be non-null");
shouldBeTrue(curr->init->is<Const>() || curr->init->is<GetGlobal>(), curr->name, "global init must be valid");
shouldBeEqual(curr->type, curr->init->type, nullptr, "global init must have correct type");
}