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

syntax: fix overflow for big counted repetitions #996

Merged
merged 1 commit into from
May 22, 2023

Commits on May 22, 2023

  1. syntax: fix overflow for big counted repetitions

    This fixes a bug where the calculation for the min/max length of a regex
    could overflow if the counted repetitions in the pattern are big enough.
    The panic only happens when debug assertions are enabled, which means
    there is no panic by default in release mode.
    
    One may wonder whether other bad things happen in release mode though,
    since in that case, the arithmetic will wrap around instead. Since this
    is in new code and since the regex crate doesn't yet utilize the min/max
    attributes of an Hir, the wrap around in this case is completely
    innocuous.
    
    Fixes #995
    BurntSushi committed May 22, 2023
    Configuration menu
    Copy the full SHA
    841022a View commit details
    Browse the repository at this point in the history