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

coverage: Avoid creating malformed macro name spans #117827

Merged
merged 2 commits into from
Nov 13, 2023

Commits on Nov 12, 2023

  1. coverage: Avoid creating malformed macro name spans

    This method is trying to detect macro invocations, so that it can split a span
    into two parts just after the `!` of the invocation.
    
    Under some circumstances (probably involving nested macros), it gets confused
    and produces a span that is larger than the original span, and possibly extends
    outside its enclosing function and even into an adjacent file.
    
    In extreme cases, that can result in malformed coverage mappings that cause
    `llvm-cov` to fail. For now, we at least want to detect these egregious cases
    and avoid them, so that coverage reports can still be produced.
    Zalathar committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    ed8298b View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2023

  1. coverage: Regression test for rust-lang#117788

    Without the workaround applied, this test will produce malformed mappings that
    cause `llvm-cov` to fail.
    
    (And if it does emit well-formed mappings, they should be obviously incorrect.)
    Zalathar committed Nov 13, 2023
    Configuration menu
    Copy the full SHA
    514e324 View commit details
    Browse the repository at this point in the history