summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm-traversal.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wasm-traversal.h b/src/wasm-traversal.h
index 47f6984dd..4eb5eb0ad 100644
--- a/src/wasm-traversal.h
+++ b/src/wasm-traversal.h
@@ -172,6 +172,11 @@ struct Walker : public VisitorType {
// Walk starting
+ void walkGlobal(Global* global) {
+ walk(global->init);
+ static_cast<SubType*>(this)->visitGlobal(global);
+ }
+
void walkFunction(Function* func) {
setFunction(func);
static_cast<SubType*>(this)->doWalkFunction(func);
@@ -219,7 +224,7 @@ struct Walker : public VisitorType {
self->visitExport(curr.get());
}
for (auto& curr : module->globals) {
- self->visitGlobal(curr.get());
+ self->walkGlobal(curr.get());
}
for (auto& curr : module->functions) {
self->walkFunction(curr.get());