Skip to content

[5.4] Fix _StringObject.init(object:...) #35313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2021

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Jan 8, 2021

Add a missing fix_lifetime. This miscompiles with OSSA because
object is destroyed before bridgeObject is retained.

Reinterpreting a reference to a trivial type always requires a
fix_lifetime.

Pushing this to 5.4 because it is in inlinable method, so hypothetically the same issue could be exposed by unforeseen optimization in the app code.

Fixes rdar://72936583 ([CanonicalOSSA] _StringObject.init(object:...) requires a _fixLifetime call)

@atrick atrick requested a review from a team as a code owner January 8, 2021 19:09
@atrick
Copy link
Contributor Author

atrick commented Jan 8, 2021

@swift-ci test

Add a missing fix_lifetime. This miscompiles with OSSA because
`object` is destroyed before `bridgeObject` is retained.

Reinterpreting a reference to a trivial type always requires a
fix_lifetime.

Fixes rdar://72936583 ([CanonicalOSSA] _StringObject.init(object:...)
requires a _fixLifetime call)
@atrick atrick force-pushed the 5.4-fix-stringinit branch from fce42ee to a62ec5a Compare January 8, 2021 19:10
@atrick
Copy link
Contributor Author

atrick commented Jan 8, 2021

@swift-ci test

@atrick
Copy link
Contributor Author

atrick commented Jan 8, 2021

-- CCC ---
Explanation: Add a _fixLifetime in _StringObject.init(object:...)

Scope: This was exposed by new OSSA-based optimization within the stdlib; however, the method is inlinable, so the issue could potentially be exposed by unforeseen optimization in the application code.

Radar/SR Issue: rdar://72936583 ([CanonicalOSSA] _StringObject.init(object:...) requires a _fixLifetime call)

Origin: Primordial

Risk: There is a potential risk of minor performance regressions. Improving those will require designing an alternative to _fixLifetime.

Testing: Regular testing and benchmarking.

Reviewer: @milseman

@airspeedswift
Copy link
Member

Original: #35243

@atrick atrick merged commit 52f9da7 into swiftlang:release/5.4 Jan 9, 2021
@atrick atrick deleted the 5.4-fix-stringinit branch January 9, 2021 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants