Skip to content

Add precondition to Layout that the align fit in a u32. - #43217

Merged
bors merged 1 commit into
rust-lang:masterfrom
pnkfelix:alloc-requires-align-it-in-u32
Jul 28, 2017
Merged

bors merged 1 commit into
rust-lang:masterfrom
pnkfelix:alloc-requires-align-it-in-u32

Conversation

@pnkfelix

Copy link
Copy Markdown
Contributor

Add precondition to Layout that the align not exceed 2^31.

This precondition takes the form of a behavorial change in Layout::from_size_align (so it returns None if the input align is too large) and a new requirement for safe usage of Layout::from_size_align_unchecked.

Fix #30170.

This precondition takes the form of a behavorial change in
`Layout::from_size_align` (so it returns `None` if the `align` is too
large) and a new requirement for safe usage of
`Layout::from_size_align_unchecked`.

Fix rust-lang#30170.
@pnkfelix

Copy link
Copy Markdown
Contributor Author

cc #32838

@pnkfelix pnkfelix added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 13, 2017
@carols10cents

Copy link
Copy Markdown
Member

r? @alexcrichton

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+

Thanks @pnkfelix!

@arielb1 arielb1 added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 18, 2017
@arielb1

arielb1 commented Jul 18, 2017

Copy link
Copy Markdown
Contributor

@bors r=alexcrichton

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+

@bors

bors commented Jul 27, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit ef8804b has been approved by alexcrichton

@bors

bors commented Jul 28, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit ef8804b with merge 63b3a03...

bors added a commit that referenced this pull request Jul 28, 2017
…xcrichton

Add precondition to `Layout` that the `align` fit in a u32.

Add precondition to `Layout` that the `align` not exceed 2^31.

This precondition takes the form of a behavorial change in `Layout::from_size_align` (so it returns `None` if the input `align` is too large) and a new requirement for safe usage of `Layout::from_size_align_unchecked`.

Fix #30170.
@bors

bors commented Jul 28, 2017

Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 63b3a03 to master...

@bors
bors merged commit ef8804b into rust-lang:master Jul 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants