From a32c0eff473d39b816679a5f7c65b522886726b0 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 21 Feb 2017 10:29:59 -0800 Subject: allow traversing the inits of globals (#917) --- src/wasm-traversal.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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(this)->visitGlobal(global); + } + void walkFunction(Function* func) { setFunction(func); static_cast(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()); -- cgit v1.2.3