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

[SILGen] Fix the type of closure thunks that are passed const reference structs #76855

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 3, 2024

  1. [SILGen] Fix the type of closure thunks that are passed const referen…

    …ce structs (#75491)
    
    The thunk's parameter needs the @in_guaranteed convention if it's a
    const reference parameter. However, that convention wasn't being used
    because clang importer was removing the const reference from the
    type and SILGen was computing the type of the parameter based on the
    type without const reference.
    
    This commit fixes the bug by passing the clang function type to
    SILDeclRef so that it can be used to compute the correct thunk type.
    
    This fixes a crash when a closure is passed to a C function taking a
    pointer to a function that has a const reference struct parameter.
    
    rdar://131321096
    ahatanaka committed Oct 3, 2024
    Configuration menu
    Copy the full SHA
    60304cf View commit details
    Browse the repository at this point in the history