File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -519,15 +519,24 @@ OwnershipCompatibilityUseChecker::visitBuiltinInst(BuiltinInst *I) {
519
519
520
520
OwnershipUseCheckerResult
521
521
OwnershipCompatibilityUseChecker::visitAssignInst (AssignInst *I) {
522
- if (getValue () == I->getSrc ())
522
+ if (getValue () == I->getSrc ()) {
523
+ if (isAddressOrTrivialType ()) {
524
+ return {compatibleWithOwnership (ValueOwnershipKind::Trivial), false };
525
+ }
523
526
return {compatibleWithOwnership (ValueOwnershipKind::Owned), true };
527
+ }
528
+
524
529
return {true , false };
525
530
}
526
531
527
532
OwnershipUseCheckerResult
528
533
OwnershipCompatibilityUseChecker::visitStoreInst (StoreInst *I) {
529
- if (getValue () == I->getSrc ())
534
+ if (getValue () == I->getSrc ()) {
535
+ if (isAddressOrTrivialType ()) {
536
+ return {compatibleWithOwnership (ValueOwnershipKind::Trivial), false };
537
+ }
530
538
return {compatibleWithOwnership (ValueOwnershipKind::Owned), true };
539
+ }
531
540
return {true , false };
532
541
}
533
542
You can’t perform that action at this time.
0 commit comments