Skip to content

Do not loop forever when skip_lines regexp matches zero length with anchors#110

Merged
kou merged 4 commits intoruby:masterfrom
crazymykl:fix-infinite-loop
Nov 3, 2019
Merged

Do not loop forever when skip_lines regexp matches zero length with anchors#110
kou merged 4 commits intoruby:masterfrom
crazymykl:fix-infinite-loop

Conversation

@crazymykl
Copy link
Contributor

@crazymykl crazymykl commented Nov 1, 2019

This started failing in v3.0.2.

There is a minimal repro case in the test.

@crazymykl
Copy link
Contributor Author

Another approach that would work is to set skip_blanks if the skip_lines pattern matches an empty string during initialization; that would avoid changes in the hot loop.

@kou kou merged commit 3b15d4a into ruby:master Nov 3, 2019
@kou
Copy link
Member

kou commented Nov 3, 2019

Thanks.
I chose eos? in skip_needless_lines? because the same problem is happen by another skip_needless_lines? call with the original approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants