summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ir/module-utils.h4
-rw-r--r--src/wasm.h15
2 files changed, 17 insertions, 2 deletions
diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h
index d84648dfd..014fcb34c 100644
--- a/src/ir/module-utils.h
+++ b/src/ir/module-utils.h
@@ -135,8 +135,8 @@ inline void clearModule(Module& wasm) {
wasm.functions.clear();
wasm.globals.clear();
wasm.events.clear();
- wasm.table.segments.clear();
- wasm.memory.segments.clear();
+ wasm.table.clear();
+ wasm.memory.clear();
wasm.start = Name();
wasm.userSections.clear();
wasm.debugInfoFileNames.clear();
diff --git a/src/wasm.h b/src/wasm.h
index cc2070eb2..0ed4f27bd 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -1241,6 +1241,13 @@ public:
Table() { name = Name::fromInt(0); }
bool hasMax() { return max != kUnlimitedSize; }
+ void clear() {
+ exists = false;
+ name = "";
+ initial = 0;
+ max = kMaxSize;
+ segments.clear();
+ }
};
class Memory : public Importable {
@@ -1284,6 +1291,14 @@ public:
Memory() { name = Name::fromInt(0); }
bool hasMax() { return max != kUnlimitedSize; }
+ void clear() {
+ exists = false;
+ name = "";
+ initial = 0;
+ max = kMaxSize;
+ segments.clear();
+ shared = false;
+ }
};
class Global : public Importable {