Skip to content

[5.0] IRGen: Empty fields do have an entry in the field offset vector #13906

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

Conversation

aschwaighofer
Copy link
Contributor

This is an error introduced as the result of a refactoring a while ago
and means that we will store dependently typed stored properties at the
wrong offset in a generic struct if it has stored properties of empty
types before said property.

Explanation: We would compute the wrong offset for dependently typed properties inside generic structs if said property was preceded by a stored property of empty type.

public struct GenericStruct<T : Proto> {
  var empty: EmptyStruct = EmptyStruct()
  var dummy: Int = 0
  var opt: Optional<T> = nil
}

Scope: This was introduced as the result of a refactoring in the swift-4.1-branch timeframe.

Risk: Low. Single line change that only applies to empty types when we compute their offset in the field offset vector.

Testing: Swift CI Tests added.

rdar://36384871

This is an error introduced as the result of a refactoring a while ago
and means that we will store dependently typed stored properties at the
wrong offset in a generic struct if it has stored properties of empty
types before said property.

rdar://36384871
@aschwaighofer
Copy link
Contributor Author

Master PR: #13904

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please smoke test

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please smoke test

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0be6aad

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0be6aad

@aschwaighofer aschwaighofer merged commit f5945a6 into swiftlang:swift-5.0-branch Jan 23, 2018
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