summaryrefslogtreecommitdiff
path: root/src/wasm2js.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm2js.h')
-rw-r--r--src/wasm2js.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wasm2js.h b/src/wasm2js.h
index 927dbac24..ee682f58d 100644
--- a/src/wasm2js.h
+++ b/src/wasm2js.h
@@ -638,6 +638,13 @@ void Wasm2JSBuilder::addGlobal(Ref ast, Global* global) {
fromName(global->name, NameScope::Top),
theValue
);
+ } else if (auto* get = global->init->dynCast<GetGlobal>()) {
+ Ref theVar = ValueBuilder::makeVar();
+ ast->push_back(theVar);
+ ValueBuilder::appendToVar(theVar,
+ fromName(global->name, NameScope::Top),
+ ValueBuilder::makeName(fromName(get->name, NameScope::Top))
+ );
} else {
assert(false && "Top init type not supported");
}