summaryrefslogtreecommitdiffstats
path: root/lld/wasm/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/wasm/Writer.cpp')
-rw-r--r--lld/wasm/Writer.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index 301326ba375..fa9c0df6a05 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -602,17 +602,15 @@ void Writer::calculateOffsets() {
// Elem
uint32_t SegmentCount = WasmFile->elements().size();
if (SegmentCount) {
- if (SegmentCount > 1) {
+ if (SegmentCount > 1)
fatal(File->getName() + ": contains more than element segment");
- } else {
- const WasmElemSegment &Segment = WasmFile->elements()[0];
- if (Segment.TableIndex != 0)
- fatal(File->getName() + ": unsupported table index");
- else if (Segment.Offset.Value.Int32 != 0)
- fatal(File->getName() + ": unsupported segment offset");
- else
- NumElements += Segment.Functions.size();
- }
+
+ const WasmElemSegment &Segment = WasmFile->elements()[0];
+ if (Segment.TableIndex != 0)
+ fatal(File->getName() + ": unsupported table index");
+ if (Segment.Offset.Value.Int32 != 0)
+ fatal(File->getName() + ": unsupported segment offset");
+ NumElements += Segment.Functions.size();
}
}
}
OpenPOWER on IntegriCloud