summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-emscripten.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-emscripten.cpp')
-rw-r--r--src/wasm/wasm-emscripten.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp
index e09ad98d2..a383a812a 100644
--- a/src/wasm/wasm-emscripten.cpp
+++ b/src/wasm/wasm-emscripten.cpp
@@ -919,10 +919,11 @@ std::string EmscriptenGlueGenerator::generateEmscriptenMetadata(
return meta.str();
}
-void EmscriptenGlueGenerator::separateDataSegments(Output* outfile) {
+void EmscriptenGlueGenerator::separateDataSegments(Output* outfile, Address base) {
size_t lastEnd = 0;
for (Memory::Segment& seg : wasm.memory.segments) {
size_t offset = seg.offset->cast<Const>()->value.geti32();
+ offset -= base;
size_t fill = offset - lastEnd;
if (fill > 0) {
std::vector<char> buf(fill);