Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails if the pattern is of length 0 #4

Closed
zacps opened this issue Feb 7, 2020 · 1 comment
Closed

Fails if the pattern is of length 0 #4

zacps opened this issue Feb 7, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@zacps
Copy link

zacps commented Feb 7, 2020

The problematic line is here.

final mask = 1 << (patternLen <= 31 ? patternLen - 1 : 30);

If patternLen = 0 then (patternLen <= 31 ? patternLen - 1 : 30)=-1 which promptly fails the shift.

@comigor
Copy link
Owner

comigor commented Feb 7, 2020

Hey again @zacps, thanks for pointing this!

Could you open a PR fixing this issue? I'd greatly appreaciate it!

@comigor comigor added the bug Something isn't working label Feb 7, 2020
comigor added a commit that referenced this issue Mar 11, 2020
[fix] fix range errors, allow empty pattern, fixes #3, fixes #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants