summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-emscripten.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-05-01 09:18:44 -0700
committerGitHub <noreply@github.com>2019-05-01 09:18:44 -0700
commitac93469d7fde75397403db94d9bf0c1bac0cf60f (patch)
tree1542a6f13368adf6d797aafc9afe29822bb55fe8 /src/wasm/wasm-emscripten.cpp
parent8d4bcd6e02bb0df3ac87e4850896ba733525b055 (diff)
downloadbinaryen-ac93469d7fde75397403db94d9bf0c1bac0cf60f.tar.gz
binaryen-ac93469d7fde75397403db94d9bf0c1bac0cf60f.tar.bz2
binaryen-ac93469d7fde75397403db94d9bf0c1bac0cf60f.zip
Proper errors on unsupported segment types in EmscriptenGlueGenerator::separateDataSegments (#2068)
Diffstat (limited to 'src/wasm/wasm-emscripten.cpp')
-rw-r--r--src/wasm/wasm-emscripten.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp
index c1bb36338..a6a84a974 100644
--- a/src/wasm/wasm-emscripten.cpp
+++ b/src/wasm/wasm-emscripten.cpp
@@ -1005,7 +1005,12 @@ void EmscriptenGlueGenerator::separateDataSegments(Output* outfile,
Address base) {
size_t lastEnd = 0;
for (Memory::Segment& seg : wasm.memory.segments) {
- assert(!seg.isPassive && "separating passive segments not implemented");
+ if (seg.isPassive) {
+ Fatal() << "separating passive segments not implemented";
+ }
+ if (!seg.offset->is<Const>()) {
+ Fatal() << "separating relocatable segments not implemented";
+ }
size_t offset = seg.offset->cast<Const>()->value.geti32();
offset -= base;
size_t fill = offset - lastEnd;