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

CFI: Strip auto traits off Virtual calls #122879

Merged
merged 2 commits into from
Mar 24, 2024
Merged

Commits on Mar 23, 2024

  1. CFI: Use Instance at callsites

    We already use `Instance` at declaration sites when available to glean
    additional information about possible abstractions of the type in use.
    This does the same when possible at callsites as well.
    
    The primary purpose of this change is to allow CFI to alter how it
    generates type information for indirect calls through `Virtual`
    instances.
    maurer committed Mar 23, 2024
    Configuration menu
    Copy the full SHA
    7967915 View commit details
    Browse the repository at this point in the history
  2. CFI: Strip auto traits off Self for virtual calls

    Additional trait bounds beyond the principal trait and its implications
    are not possible in the vtable. This means that if a receiver is
    `&dyn Foo + Send`, the function will only be expecting `&dyn Foo`.
    
    This strips those auto traits off before CFI encoding.
    maurer committed Mar 23, 2024
    Configuration menu
    Copy the full SHA
    f434c27 View commit details
    Browse the repository at this point in the history