summaryrefslogtreecommitdiff
path: root/src/wasm/wasm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm.cpp')
-rw-r--r--src/wasm/wasm.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index 54e9dd142..b21c1849a 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -1568,6 +1568,13 @@ void Module::removeTags(std::function<bool(Tag*)> pred) {
removeModuleElements(tags, tagsMap, pred);
}
+void Module::updateFunctionsMap() {
+ functionsMap.clear();
+ for (auto& curr : functions) {
+ functionsMap[curr->name] = curr.get();
+ }
+}
+
void Module::updateDataSegmentsMap() {
dataSegmentsMap.clear();
for (auto& curr : dataSegments) {
@@ -1576,10 +1583,7 @@ void Module::updateDataSegmentsMap() {
}
void Module::updateMaps() {
- functionsMap.clear();
- for (auto& curr : functions) {
- functionsMap[curr->name] = curr.get();
- }
+ updateFunctionsMap();
exportsMap.clear();
for (auto& curr : exports) {
exportsMap[curr->name] = curr.get();