Skip to content

fix Miri offset_from - #66083

Merged
bors merged 5 commits into
rust-lang:masterfrom
RalfJung:miri-offset-from
Nov 5, 2019
Merged

fix Miri offset_from#66083
bors merged 5 commits into
rust-lang:masterfrom
RalfJung:miri-offset-from

Conversation

@RalfJung

Copy link
Copy Markdown
Member

This is needed to make rust-lang/miri#1032 pass.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @varkor

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 4, 2019
@RalfJung

Copy link
Copy Markdown
MemberAuthor

This PR fixes https://github.com/RalfJung/miri-test-libstd, which currently fails.

@RalfJung

Copy link
Copy Markdown
MemberAuthor

r? @oli-obk

@rust-highfiverust-highfive assigned oli-obk and unassigned varkorNov 5, 2019
let b = self.read_immediate(args[1])?.to_scalar()?;

// Special case: if both scalars are *equal integers*
// and not NULL, their offset is 0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is the null case important? The docs state nothing of the kind. Or is the "valid object" thing the problem?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, since wrapping_offset_from is safe, and you can supply null pointers to it... I guess this should be allowed?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Indeed this is about the "valid object" part. There's never a valid object at 0, not even one of size 0, so 0 is never a valid input here.

wrapping_offset_from does not have the "valid object" requirement.

@RalfJung

Copy link
Copy Markdown
MemberAuthor

@bors r=oli-obk p=1
(priority because this breaks Miri's test suite.)

@bors

bors commented Nov 5, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit a593b54 has been approved by oli-obk

@borsbors 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 Nov 5, 2019
@bors

bors commented Nov 5, 2019

Copy link
Copy Markdown
Collaborator

⌛ Testing commit a593b54 with merge 3a1b3b3...

bors added a commit that referenced this pull request Nov 5, 2019
@bors

bors commented Nov 5, 2019

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-azure
Approved by: oli-obk
Pushing 3a1b3b3 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Nov 5, 2019
@bors
bors merged commit a593b54 into rust-lang:masterNov 5, 2019
bors added a commit to rust-lang/miri that referenced this pull request Nov 5, 2019
test offset_from
This currently fails and needs a rustc fix: rust-lang/rust#66083
@RalfJung
RalfJung deleted the miri-offset-from branch November 6, 2019 10:05
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: 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

@RalfJung@rust-highfive@bors@oli-obk@varkor