Skip to content

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

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

@aschwaighofer aschwaighofer commented Jan 12, 2018

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.

Reviewed by: Erik

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

@swift-ci Please test

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test source compatibility

@aschwaighofer
Copy link
Contributor Author

Master PR: #13904

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - bceabad

@aschwaighofer
Copy link
Contributor Author

Oh, right old mangling on 4.1 ...

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - bceabad

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - bceabad

@aschwaighofer
Copy link
Contributor Author

The latest source compat suite run is here: https://ci.swift.org/view/Pull%20Request/job/swift-PR-source-compat-suite/559/

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 22afda1

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - bceabad

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 22afda1

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test source compatibility

@aschwaighofer
Copy link
Contributor Author

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please nominate

@aschwaighofer
Copy link
Contributor Author

@swift-ci please nominate

@aschwaighofer
Copy link
Contributor Author

@swift-ci nominate

@aschwaighofer aschwaighofer merged commit 1e6e389 into swiftlang:swift-4.1-branch Jan 16, 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