-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Metadata/IRGen] NFC: Couple of field metadata related improvements #14776
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
@swift-ci please test |
@swift-ci please test source compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one C semantics nitpick. This LGTM otherwise.
|
||
int compareWithKey(const Metadata *other) const { | ||
return Base == other; | ||
return Type == other ? 0 : (Type < other ? -1 : 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comparing unrelated pointers is UB in C/C++. Strictly, you need to do (uintptr_t)Type < (uintptr_t)Other
there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah interesting, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
91e822e
to
333f614
Compare
@swift-ci please test |
@swift-ci please test source compatibility |
This PR does following:
Resolves: rdar://problem/26060144