File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,8 @@ public struct Module {
129129 /// > Note:
130130 /// <https://webassembly.github.io/spec/core/exec/modules.html#instantiation>
131131 private func instantiateHandle( store: Store , imports: Imports ) throws -> InternalInstance {
132+ try ModuleValidator ( ) . validate ( self )
133+
132134 // Steps 5-8.
133135
134136 // Step 9.
Original file line number Diff line number Diff line change @@ -24,3 +24,11 @@ struct InstructionValidator {
2424 }
2525 }
2626}
27+
28+ struct ModuleValidator {
29+ func validate( _ module: Module ) throws {
30+ if module. memoryTypes. count > 1 {
31+ throw ValidationError ( " Multiple memories are not permitted " )
32+ }
33+ }
34+ }
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ final class SpectestTests: XCTestCase {
2222 path: Self . testPaths,
2323 include: [ ] ,
2424 exclude: [
25- " imports.wast " ,
2625 " labels.wast " ,
2726 " load.wast " ,
2827 " local_get.wast " ,
You can’t perform that action at this time.
0 commit comments