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

Fix find_width_of_character_at_span bounds check #48522

Merged
merged 3 commits into from
Mar 2, 2018
Merged

Fix find_width_of_character_at_span bounds check #48522

merged 3 commits into from
Mar 2, 2018

Commits on Feb 25, 2018

  1. Fix find_width_of_character_at_span bounds check

    Commit 0bd9667 added bounds checking of our current target byte
    position to prevent infinite loops. Unfortunately it was comparing the
    file-relative `target` versus the global relative `file_start_pos` and
    `file_end_pos`.
    
    The result is failing to detect multibyte characters unless their
    file-relative offset fit within their global offset. This causes other
    parts of the compiler to generate spans pointing to the middle of a
    multibyte character which will ultimately panic in
    `bytepos_to_file_charpos`.
    
    Fix by comparing the `target` to the total file size when moving forward
    and doing checked subtraction when moving backwards. This should
    preserve the intent of the bounds check while removing the offset
    confusion.
    
    Fixes #48508
    etaoins committed Feb 25, 2018
    Configuration menu
    Copy the full SHA
    d27fac6 View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2018

  1. Add test for #48508

    This is named for the issue as it's testing the specific details of that
    bug. It's a bit tricky as the ICE requires multiple files and debug info
    enabled to trigger.
    etaoins committed Feb 26, 2018
    Configuration menu
    Copy the full SHA
    c237d4f View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2018

  1. Add ignore-pretty for issue-48506.rs

    The out-of-line module #37195
    etaoins committed Mar 1, 2018
    Configuration menu
    Copy the full SHA
    363d604 View commit details
    Browse the repository at this point in the history