Skip to content

Conversation

jckarter
Copy link
Contributor

@jckarter jckarter commented Nov 6, 2017

Explanation: Fixes an out-of-bounds access when using optional-chaining key paths in generic contexts or with index elements.

Scope: Fixes a runtime crash that many users have been running into.

Issue: SR-6096 | rdar://problem/35367114

Risk: Low

Testing: Swift CI, test case from Jira

…tional chaining components.

When we pre-scan the components of a key path pattern to determine its runtime type and instance size, we would short-circuit upon seeing an optional-chaining component, since that makes a key path definitely read-only, but the loop also accumulates the size of the instance we're supposed to allocate, so…bad stuff happened. Leave out the short-circuit, fixing SR-6096 | rdar://problem/34889333 .
@jckarter jckarter requested a review from slavapestov November 6, 2017 18:30
@jckarter
Copy link
Contributor Author

jckarter commented Nov 6, 2017

@slavapestov Mind reviewing this for the 4.0 branch?

@jckarter
Copy link
Contributor Author

jckarter commented Nov 6, 2017

@swift-ci Please test

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops!

@tkremenek tkremenek merged commit 738a7fb into swiftlang:swift-4.0-branch Nov 6, 2017
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.

3 participants