Skip to content
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

miri engine: add option to use force_int for alignment check #75592

Merged
merged 2 commits into from
Aug 17, 2020

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Aug 16, 2020

This is needed for rust-lang/miri#1074. The Miri-side patch is at rust-lang/miri#1513.

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 16, 2020
Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

r=me with comment nit

src/librustc_mir/interpret/machine.rs Outdated Show resolved Hide resolved
// We instead have to fall back to converting to an integer and checking
// the "real" alignment.
throw_ub!(AlignmentCheckFailed { has: alloc_align, required: align });
if M::force_int_for_alignment_check(&self.extra) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking we could make the hook do the check, but I guess that would lead to a lot of duplication in miri where we want to be able to choose between both options at runtime.

Copy link
Member Author

@RalfJung RalfJung Aug 17, 2020

Choose a reason for hiding this comment

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

Yeah, also I'd rather have all the checking code in one place. This is critical code to get right.

Co-authored-by: Oliver Scherer <github35764891676564198441@oli-obk.de>
@RalfJung
Copy link
Member Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Aug 17, 2020

📌 Commit 6da8503 has been approved by oli-obk

@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 Aug 17, 2020
@bors
Copy link
Contributor

bors commented Aug 17, 2020

⌛ Testing commit 6da8503 with merge 8cdc94e...

@bors
Copy link
Contributor

bors commented Aug 17, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: oli-obk
Pushing 8cdc94e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 17, 2020
@bors bors merged commit 8cdc94e into rust-lang:master Aug 17, 2020
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #75592!

Tested on commit 8cdc94e.
Direct link to PR: #75592

💔 miri on windows: test-pass → build-fail (cc @oli-obk @eddyb @RalfJung).
💔 miri on linux: test-pass → build-fail (cc @oli-obk @eddyb @RalfJung).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Aug 17, 2020
Tested on commit rust-lang/rust@8cdc94e.
Direct link to PR: <rust-lang/rust#75592>

💔 miri on windows: test-pass → build-fail (cc @oli-obk @eddyb @RalfJung).
💔 miri on linux: test-pass → build-fail (cc @oli-obk @eddyb @RalfJung).
@RalfJung RalfJung deleted the miri-int-align branch August 17, 2020 14:44
bors added a commit to rust-lang/miri that referenced this pull request Aug 17, 2020
add option to use force_int for alignment check

Fixes #1074. Depends on rust-lang/rust#75592.
bors added a commit to rust-lang/miri that referenced this pull request Aug 17, 2020
add option to use force_int for alignment check

Fixes #1074. Depends on rust-lang/rust#75592.
bors added a commit to rust-lang/miri that referenced this pull request Aug 17, 2020
add option to use force_int for alignment check

Fixes #1074. Depends on rust-lang/rust#75592.
bors added a commit to rust-lang/miri that referenced this pull request Aug 17, 2020
add option to use force_int for alignment check

Fixes #1074. Depends on rust-lang/rust#75592.
bors added a commit to rust-lang/miri that referenced this pull request Aug 17, 2020
add option to use force_int for alignment check

Fixes #1074. Depends on rust-lang/rust#75592.
bors added a commit to rust-lang/miri that referenced this pull request Aug 17, 2020
add option to use force_int for alignment check

Fixes #1074. Depends on rust-lang/rust#75592.
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

None yet

5 participants