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

[release/7.0] React to CheckForOverflowUnderflow in regex source generator #78256

Merged
merged 2 commits into from
Nov 14, 2022

Commits on Nov 11, 2022

  1. React to CheckForOverflowUnderflow in regex source generator

    The regex source generator uses code patterns that might have arithmetic overflows, e.g. a bounds check with `(uint)index < span.Length`.  These are intentional, and they're benign... unless the project/compilation has opted-in to overflow/underflow checking (CheckForOverflowUnderflow).  In that case, the code for many patterns can start throwing false positive overflow exceptions, making the source generator unusable.
    
    This commit causes the generator to look at the CheckOverflow setting in the compilation options, and if it's set, to emit `unchecked { ... }` around all the relevant code.
    stephentoub authored and github-actions committed Nov 11, 2022
    Configuration menu
    Copy the full SHA
    985a5ad View commit details
    Browse the repository at this point in the history
  2. Address PR feedback

    stephentoub authored and github-actions committed Nov 11, 2022
    Configuration menu
    Copy the full SHA
    5fede79 View commit details
    Browse the repository at this point in the history