summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2021-04-09 10:31:16 -0700
committerGitHub <noreply@github.com>2021-04-09 10:31:16 -0700
commit67094a4a9b013a9705bcbf49ec7e0e8ab744389c (patch)
treeffb21aa8b4d6d4450f7f6eaaea1c2bcfe592d99c /src
parenteb80aec0fa55357167f60afe7661015ae482f3e7 (diff)
downloadbinaryen-67094a4a9b013a9705bcbf49ec7e0e8ab744389c.tar.gz
binaryen-67094a4a9b013a9705bcbf49ec7e0e8ab744389c.tar.bz2
binaryen-67094a4a9b013a9705bcbf49ec7e0e8ab744389c.zip
wasm-split: Update dylink section when growing table (#3791)
Diffstat (limited to 'src')
-rw-r--r--src/ir/module-splitting.cpp3
-rw-r--r--src/ir/table-utils.h2
-rw-r--r--src/wasm.h2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/ir/module-splitting.cpp b/src/ir/module-splitting.cpp
index 68496045f..7f12269f8 100644
--- a/src/ir/module-splitting.cpp
+++ b/src/ir/module-splitting.cpp
@@ -247,6 +247,9 @@ TableSlotManager::Slot TableSlotManager::getSlot(RefFunc* entry) {
addSlot(entry->func, newSlot);
if (activeTable->initial <= newSlot.index) {
activeTable->initial = newSlot.index + 1;
+ if (module.dylinkSection) {
+ module.dylinkSection->tableSize = activeTable->initial;
+ }
}
if (activeTable->max <= newSlot.index) {
activeTable->max = newSlot.index + 1;
diff --git a/src/ir/table-utils.h b/src/ir/table-utils.h
index d2f90626a..59d7cc3df 100644
--- a/src/ir/table-utils.h
+++ b/src/ir/table-utils.h
@@ -88,7 +88,7 @@ inline Index append(Table& table, Name name, Module& wasm) {
auto* func = wasm.getFunctionOrNull(name);
assert(func != nullptr && "Cannot append non-existing function to a table.");
segment->data.push_back(Builder(wasm).makeRefFunc(name, func->sig));
- table.initial = table.initial + 1;
+ table.initial++;
return tableIndex;
}
diff --git a/src/wasm.h b/src/wasm.h
index 050240333..fb1396f19 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -55,7 +55,7 @@ struct Address {
return *this;
}
operator address64_t() const { return addr; }
- Address& operator++() {
+ Address& operator++(int) {
++addr;
return *this;
}