swift
e0744260 - [SILGen] Fix the type of closure thunks that are passed const reference structs (#75491)

Commit
354 days ago
[SILGen] Fix the type of closure thunks that are passed const reference 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
Author
Parents
Loading