Skip to content

Fix a bug in OptimizedStructLayout when filling gaps before #3124

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
Jul 22, 2021

Conversation

hyp
Copy link

@hyp hyp commented Jul 21, 2021

fixed fields with highly-aligned flexible fields.

The code was not considering the possibility that aligning
the current offset to the alignment of a queue might push
us past the end of the gap. Subtracting the offsets to
figure out the maximum field size for the gap then overflowed,
making us think that we had nearly unbounded space to fill.

Fixes PR 51131.

(cherry picked from commit 326a5a2)

fixed fields with highly-aligned flexible fields.

The code was not considering the possibility that aligning
the current offset to the alignment of a queue might push
us past the end of the gap.  Subtracting the offsets to
figure out the maximum field size for the gap then overflowed,
making us think that we had nearly unbounded space to fill.

Fixes PR 51131.

(cherry picked from commit 326a5a2)
@hyp hyp requested a review from rjmccall July 21, 2021 20:56
@hyp
Copy link
Author

hyp commented Jul 21, 2021

@swift-ci please test

Copy link

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

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

Yep, this looks like my patch :)

@hyp
Copy link
Author

hyp commented Jul 22, 2021

@swift-ci please test

@hyp hyp merged commit c2e4782 into apple/stable/20210107 Jul 22, 2021
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