[ConsumeAddrChecker] Check inout_aliasable args.

Such values can be referenced in a `ConsumeExpr`, so the checker must
check them.  Furthermore it's legal to consume such values some of the
time.
This commit is contained in:
Nate Chandler
2024-03-12 12:27:45 -07:00
parent aac2051e68
commit 862ee47c6b
3 changed files with 12 additions and 5 deletions

View File

@@ -2466,7 +2466,8 @@ class ConsumeOperatorCopyableAddressesCheckerPass
if (arg->getType().isAddress() &&
(arg->hasConvention(SILArgumentConvention::Indirect_In) ||
arg->hasConvention(SILArgumentConvention::Indirect_In_Guaranteed) ||
arg->hasConvention(SILArgumentConvention::Indirect_Inout)))
arg->hasConvention(SILArgumentConvention::Indirect_Inout) ||
arg->hasConvention(SILArgumentConvention::Indirect_InoutAliasable)))
addressesToCheck.insert(arg);
}