Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Sources/WasmParser/LEB.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@usableFromInline
enum LEBError: Swift.Error, Equatable {
case overflow
case integerRepresentationTooLong
case insufficientBytes
}

@inline(__always)
@inlinable
func decodeLEB128<IntType, Stream>(
stream: Stream
) throws -> IntType where IntType: FixedWidthInteger, IntType: UnsignedInteger, Stream: ByteStream {
Expand Down Expand Up @@ -32,6 +33,7 @@ func decodeLEB128<IntType, Stream>(
return result
}

@inlinable
func decodeLEB128<IntType, Stream>(
stream: Stream
) throws -> IntType where IntType: FixedWidthInteger, IntType: RawSignedInteger, Stream: ByteStream {
Expand Down
2 changes: 2 additions & 0 deletions Sources/WasmParser/ParsingLimits.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/// Limits for parsing WebAssembly modules.
@usableFromInline
struct ParsingLimits {
/// Maximum number of locals in a function.
@usableFromInline
var maxFunctionLocals: UInt64

/// The default limits for parsing.
Expand Down
1 change: 1 addition & 0 deletions Sources/WasmParser/Stream/Stream.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@usableFromInline
enum StreamError<Element>: Swift.Error, Equatable where Element: Hashable {
case unexpectedEnd(expected: Set<Element>?)
case unexpected(Element, index: Int, expected: Set<Element>?)
Expand Down
Loading