Skip to content

Commit 9ae4b34

Browse files
Validation: Check for duplicate export names
1 parent 8c3092d commit 9ae4b34

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/WasmKit/Execution/StoreAllocator.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,9 @@ extension StoreAllocator {
429429
}
430430

431431
let exports: [String: InternalExternalValue] = try module.exports.reduce(into: [:]) { result, export in
432+
guard result[export.name] == nil else {
433+
throw ValidationError("Duplicate export name: \(export.name)")
434+
}
432435
result[export.name] = try createExportValue(export)
433436
}
434437

Tests/WasmKitTests/SpectestTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ final class SpectestTests: XCTestCase {
2222
path: Self.testPaths,
2323
include: [],
2424
exclude: [
25-
"exports.wast",
2625
"func.wast",
2726
"func_ptrs.wast",
2827
"global.wast",

0 commit comments

Comments
 (0)