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
2 changes: 2 additions & 0 deletions Sources/_StringProcessing/ByteCodeGen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,8 @@ extension DSLTree.Node {
case .atom(let atom):
switch atom {
case .changeMatchingOptions, .assertion: return false
// Captures may be nil so backreferences may be zero length matches
case .backreference: return false
default: return true
}
case .trivia, .empty:
Expand Down
4 changes: 4 additions & 0 deletions Tests/RegexTests/MatchTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2549,4 +2549,8 @@ extension RegexTests {
expectProgram(for: "a{\(maxStorable-1),\(maxStorable*2)}", doesNotContain: [.quantify])
expectProgram(for: "a{\(maxStorable),\(maxStorable*2+1)}", doesNotContain: [.quantify])
}

func testFuzzerArtifacts() throws {
expectCompletion(regex: #"(b?)\1*"#, in: "a")
}
}