swiftlang / swift-experimental-string-processing

An early experimental general-purpose pattern matching engine for Swift.
Apache License 2.0
278 stars 47 forks source link

[5.8] Stop at end of search string in TwoWaySearcher #633

Closed natecook1000 closed 1 year ago

natecook1000 commented 1 year ago

Cherry-picked from #631

When searching for a substring that doesn't exist, it was possible for TwoWaySearcher to advance beyond the end of the search string, causing a crash. This change adds a limitedBy: parameter to that index movement, avoiding the invalid movement.

Fixes rdar://105154010

natecook1000 commented 1 year ago

@swift-ci Please test

natecook1000 commented 1 year ago

@swift-ci Please test