File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2004,6 +2004,7 @@ struct InstructionTranslator<Context: TranslatorContext>: InstructionVisitor {
20042004 // -----------------------------------------------------------------------------
20052005 // C ⊦ table.copy d s : [iN iM iK] → []
20062006 // https://github.com/WebAssembly/memory64/blob/main/proposals/memory64/Overview.md
2007+ try validator. validateTableCopy ( dest: dstTable, source: srcTable)
20072008 let destIsMemory64 = try module. isMemory64 ( tableIndex: dstTable)
20082009 let sourceIsMemory64 = try module. isMemory64 ( tableIndex: srcTable)
20092010 let lengthIsMemory64 = destIsMemory64 && sourceIsMemory64
Original file line number Diff line number Diff line change @@ -43,6 +43,14 @@ struct InstructionValidator<Context: TranslatorContext> {
4343 }
4444 }
4545
46+ func validateTableCopy( dest: UInt32 , source: UInt32 ) throws {
47+ let tableType1 = try context. tableType ( source)
48+ let tableType2 = try context. tableType ( dest)
49+ guard tableType1. elementType == tableType2. elementType else {
50+ throw ValidationError ( " Table element type mismatch in table.copy: \( tableType1. elementType) != \( tableType2. elementType) " )
51+ }
52+ }
53+
4654 func validateRefFunc( functionIndex: UInt32 ) throws {
4755 try context. validateFunctionIndex ( functionIndex)
4856 }
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- " table-sub.wast " ,
2625 " table.wast " ,
2726 " table_get.wast " ,
2827 " table_grow.wast " ,
You can’t perform that action at this time.
0 commit comments