mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Inliner: fix condition to prevent inlining of functions with dynamic-self.
Now the condition matches exactly what's checked in asserts in SILBuilder. fixes an assert in the PerformanceInliner https://bugs.swift.org/browse/SR-11817 rdar://problem/57369847
This commit is contained in:
@@ -735,9 +735,9 @@ SILFunction *swift::getEligibleFunction(FullApplySite AI,
|
||||
// Check if passed Self is the same as the Self of the caller.
|
||||
// In this case, it is safe to inline because both functions
|
||||
// use the same Self.
|
||||
if (AI.hasSelfArgument() && Caller->hasSelfParam()) {
|
||||
if (AI.hasSelfArgument() && Caller->hasSelfMetadataParam()) {
|
||||
auto CalleeSelf = stripCasts(AI.getSelfArgument());
|
||||
auto CallerSelf = Caller->getSelfArgument();
|
||||
auto CallerSelf = Caller->getSelfMetadataArgument();
|
||||
if (CalleeSelf != SILValue(CallerSelf))
|
||||
return nullptr;
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user