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 @@ -521,15 +521,24 @@ OwnershipCompatibilityUseChecker::visitBuiltinInst(BuiltinInst *I) {
521
521
522
522
OwnershipUseCheckerResult
523
523
OwnershipCompatibilityUseChecker::visitAssignInst (AssignInst *I) {
524
- if (getValue () == I->getSrc ())
524
+ if (getValue () == I->getSrc ()) {
525
+ if (isAddressOrTrivialType ()) {
526
+ return {compatibleWithOwnership (ValueOwnershipKind::Trivial), false };
527
+ }
525
528
return {compatibleWithOwnership (ValueOwnershipKind::Owned), true };
529
+ }
530
+
526
531
return {true , false };
527
532
}
528
533
529
534
OwnershipUseCheckerResult
530
535
OwnershipCompatibilityUseChecker::visitStoreInst (StoreInst *I) {
531
- if (getValue () == I->getSrc ())
536
+ if (getValue () == I->getSrc ()) {
537
+ if (isAddressOrTrivialType ()) {
538
+ return {compatibleWithOwnership (ValueOwnershipKind::Trivial), false };
539
+ }
532
540
return {compatibleWithOwnership (ValueOwnershipKind::Owned), true };
541
+ }
533
542
return {true , false };
534
543
}
535
544
You can’t perform that action at this time.
0 commit comments