Skip to content

Commit ba4577e

Browse files
committed
Add a _fixLifetime to stdlib/BridgeStorage.swift test.
Otherwise, this uniqueness check will unexpectedly succeed when tests run in optimize mode and 'c' is destroyed early: let c = C() var b = B(native: c, isFlagged: flag) //... expectFalse(b.isUniquelyReferencedUnflaggedNative()) // Keep 'c' alive for the isUniquelyReferenced check above. _fixLifetime(c) Fixes rdar://72957398 ([CanonicalOSSA] Add a _fixLifetime to stdlib/BridgeStorage.swift test.)
1 parent d25ce3d commit ba4577e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/stdlib/BridgeStorage.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ allTests.test("_BridgeStorage") {
145145
expectTrue(b.unflaggedNativeInstance === c)
146146
expectFalse(b.isUniquelyReferencedUnflaggedNative())
147147
}
148+
// Keep 'c' alive for the isUniquelyReferenced check above.
149+
_fixLifetime(c)
148150
}
149151

150152
}

0 commit comments

Comments
 (0)