Skip to content

Commit c8dc624

Browse files
WAT: Ban multiple start sections
1 parent 9b84bb8 commit c8dc624

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/WAT/WAT.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ func parseWAT(_ parser: inout Parser, features: WasmFeatureSet) throws -> Wat {
258258
case let .data(decl):
259259
try dataSegmentsMap.add(decl)
260260
case let .start(startIndex):
261+
guard start == nil else {
262+
throw WatParserError("Multiple start sections", location: location)
263+
}
261264
start = startIndex
262265
}
263266
}

Tests/WATTests/EncoderTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ class EncoderTests: XCTestCase {
107107

108108
var stats = CompatibilityTestStats()
109109
let excluded: [String] = [
110-
"start.wast",
111110
"token.wast",
112111
"utf8-invalid-encoding.wast"
113112
]

0 commit comments

Comments
 (0)