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:
Erik Eckstein
2019-11-26 12:53:40 +01:00
parent d2e1f09169
commit 66ccfd78ed
3 changed files with 31 additions and 5 deletions

View File

@@ -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