Skip to content
Closed
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
8 changes: 4 additions & 4 deletions Sources/WasmParser/Stream/ByteStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public final class StaticByteStream: ByteStream {

@discardableResult
public func consumeAny() throws -> UInt8 {
guard bytes.indices.contains(currentIndex) else {
guard currentIndex < self.bytes.endIndex else {
throw StreamError<Element>.unexpectedEnd(expected: nil)
}

Expand All @@ -27,7 +27,7 @@ public final class StaticByteStream: ByteStream {

@discardableResult
public func consume(_ expected: Set<UInt8>) throws -> UInt8 {
guard bytes.indices.contains(currentIndex) else {
guard currentIndex < self.bytes.endIndex else {
throw StreamError<Element>.unexpectedEnd(expected: Set(expected))
}

Expand All @@ -44,7 +44,7 @@ public final class StaticByteStream: ByteStream {
guard count > 0 else { return [] }
let updatedIndex = currentIndex + count

guard bytes.indices.contains(updatedIndex - 1) else {
guard updatedIndex - 1 < bytes.endIndex else {
throw StreamError<Element>.unexpectedEnd(expected: nil)
}

Expand All @@ -54,7 +54,7 @@ public final class StaticByteStream: ByteStream {
}

public func peek() -> UInt8? {
guard bytes.indices.contains(currentIndex) else {
guard currentIndex < self.bytes.endIndex else {
return nil
}
return bytes[currentIndex]
Expand Down
2 changes: 1 addition & 1 deletion Tests/WITExtractorPluginTests/PluginSmokeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import XCTest
class PluginSmokeTests: XCTestCase {
func testExtractPlugin() throws {
#if compiler(>=6.0)
throw XCTSkip("XFAIL: Swift compiler path inference is broken in Swift 6.0")
throw XCTSkip("XFAIL: Swift compiler path inference is broken in Swift 6.0")
#endif
guard ProcessInfo.processInfo.environment["__XCODE_BUILT_PRODUCTS_DIR_PATHS"] == nil else {
throw XCTSkip(
Expand Down