Skip to content

miri engine: keep around some information for dead allocations #54254

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
Sep 17, 2018

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Sep 15, 2018

We use it to test if a dangling ptr is aligned and non-NULL. This makes some code pass that should pass (writing a ZST to a properly aligned dangling pointer), and makes some code fail that should fail (writing a ZST to a pointer obtained via pointer arithmetic from a real location, but ouf-of-bounds -- that pointer could be NULL, so we cannot allow writing to it).

CTFE does not allow these operations; tests are added to miri with rust-lang/miri#453.

…it to make sure a dangling ptr aligned and non-NULL
@rust-highfive
Copy link
Contributor

r? @davidtwco

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 15, 2018
@Mark-Simulacrum
Copy link
Member

@bors try for perf

@bors
Copy link
Collaborator

bors commented Sep 15, 2018

⌛ Trying commit f3a76a1 with merge 6f153da...

bors added a commit that referenced this pull request Sep 15, 2018
miri engine: keep around some information for dead allocations

We use it to make sure a dangling ptr is aligned and non-NULL. This makes some code pass that should pass (writing a ZST to a properly aligned dangling pointer), and makes some code fail that should fail (writing a ZST to a pointer obtained via pointer arithmetic from a real location, but ouf-of-bounds -- that pointer could be NULL, so we cannot allow writing to it).

CTFE does not allow these operations; tests are added to miri with rust-lang/miri#453.
@bors
Copy link
Collaborator

bors commented Sep 15, 2018

☀️ Test successful - status-travis
State: approved= try=True

@RalfJung
Copy link
Member Author

@rust-timer build 6f153da

@rust-timer
Copy link
Collaborator

Success: Queued 6f153da with parent cba0fdf, comparison URL.

@davidtwco
Copy link
Member

This isn't a part of the compiler I'm particularly familiar with, so if there's someone you'd normally request a review from then feel free to r?.

That said, this looks good to me. So happy to r=me when ready (after rust-timer results or whatever).

@RalfJung
Copy link
Member Author

Well usually I'd ask @oli-obk but they are gone until end of the month, AFAIK. @eddyb do you have time to look at this?

@eddyb
Copy link
Member

eddyb commented Sep 15, 2018

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 15, 2018

📌 Commit f3a76a1 has been approved by eddyb

@bors bors 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 Sep 15, 2018
@bors
Copy link
Collaborator

bors commented Sep 17, 2018

⌛ Testing commit f3a76a1 with merge 0b0d2ed...

bors added a commit that referenced this pull request Sep 17, 2018
miri engine: keep around some information for dead allocations

We use it to test if a dangling ptr is aligned and non-NULL. This makes some code pass that should pass (writing a ZST to a properly aligned dangling pointer), and makes some code fail that should fail (writing a ZST to a pointer obtained via pointer arithmetic from a real location, but ouf-of-bounds -- that pointer could be NULL, so we cannot allow writing to it).

CTFE does not allow these operations; tests are added to miri with rust-lang/miri#453.
@bors
Copy link
Collaborator

bors commented Sep 17, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing 0b0d2ed to master...

@bors bors merged commit f3a76a1 into rust-lang:master Sep 17, 2018
@RalfJung RalfJung deleted the miri-dangling branch November 9, 2018 15:34
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.

7 participants