summaryrefslogtreecommitdiff
path: root/test/run-spec-wasm2c.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/run-spec-wasm2c.py')
-rwxr-xr-xtest/run-spec-wasm2c.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/run-spec-wasm2c.py b/test/run-spec-wasm2c.py
index e32c9078..59c50ed9 100755
--- a/test/run-spec-wasm2c.py
+++ b/test/run-spec-wasm2c.py
@@ -122,6 +122,7 @@ class CWriter(object):
self.module_name_to_idx = {}
self.module_prefix_map = {}
self.unmangled_names = {}
+ self.idx_to_module_name = {}
self._MaybeWriteDummyModule()
self._CacheModulePrefixes()
@@ -162,6 +163,7 @@ class CWriter(object):
if 'name' in command:
self.module_name_to_idx[command['name']] = idx
+ self.idx_to_module_name[idx] = command['name']
self.module_prefix_map[command['name']] = name
idx += 1
@@ -173,6 +175,8 @@ class CWriter(object):
else:
name_idx = idx - 1
+ if name_idx in self.idx_to_module_name:
+ self.module_prefix_map[self.idx_to_module_name[name_idx]] = name
self.module_prefix_map[name_idx] = name
self.unmangled_names[name_idx] = command['as']