File tree Expand file tree Collapse file tree 2 files changed +1
-6
lines changed Expand file tree Collapse file tree 2 files changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -2213,7 +2213,7 @@ extension FunctionType {
22132213 case let . funcType( typeIndex) :
22142214 let typeIndex = Int ( typeIndex)
22152215 guard typeIndex < typeSection. count else {
2216- throw WasmParserError . invalidTypeSectionReference
2216+ throw ValidationError ( " type index out of bounds: accessed \( typeIndex ) , but only \( typeSection . count ) types are defined " )
22172217 }
22182218 let funcType = typeSection [ typeIndex]
22192219 self . init (
Original file line number Diff line number Diff line change @@ -307,8 +307,6 @@ extension WasmParserError.Message {
307307
308308 @usableFromInline static let malformedIndirectCall = Self ( " Malformed indirect call " )
309309
310- static let invalidTypeSectionReference = Self ( " Invalid reference to a type section entry " )
311-
312310 static func malformedDataSegmentKind( _ kind: UInt32 ) -> Self {
313311 Self ( " Malformed data segment kind: \( kind) " )
314312 }
@@ -327,9 +325,6 @@ extension WasmParserError {
327325 public static var sectionOutOfOrder : Self {
328326 Self ( . sectionOutOfOrder, offset: 0 )
329327 }
330- public static var invalidTypeSectionReference : Self {
331- Self ( . invalidTypeSectionReference, offset: 0 )
332- }
333328 public static func inconsistentFunctionAndCodeLength( functionCount: Int , codeCount: Int ) -> Self {
334329 Self ( . inconsistentFunctionAndCodeLength( functionCount: functionCount, codeCount: codeCount) , offset: 0 )
335330 }
You can’t perform that action at this time.
0 commit comments