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: Fix run-time validation #54955

Merged
merged 12 commits into from
Oct 13, 2018
Merged

Conversation

RalfJung
Copy link
Member

This fixes all false positives that came up when actually enabling this in miri.

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 10, 2018
@bors

This comment has been minimized.

@RalfJung
Copy link
Member Author

Rebase done.

}
// The closure is not local, or the freevars don't match up (seen for a generator!),
Copy link
Contributor

Choose a reason for hiding this comment

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

tcx.mir_optimized(def_id).upvar_decls[upvar_index].debug_name should do it?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no such method?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

@RalfJung RalfJung Oct 11, 2018

Choose a reason for hiding this comment

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

What will that do if we don't have libstd MIR?

Copy link
Contributor

Choose a reason for hiding this comment

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

uhm... I don't see how that can happen. How would you even see a libstd closure without its MIR being available?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough.

However, for a generator, I am still seeing

index out of bounds: the len is 0 but the index is 0

So I'll have to keep some kind of fallback.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, and even added a test for it. ;)

@rust-highfive

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 11, 2018

r=me with Cargo.lock updated

@RalfJung
Copy link
Member Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Oct 11, 2018

📌 Commit c54155e00820ebba98f5a2bba7cfe07042576056 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 Oct 11, 2018
src/librustc_mir/interpret/validity.rs Outdated Show resolved Hide resolved
src/librustc_mir/interpret/memory.rs Show resolved Hide resolved
@RalfJung
Copy link
Member Author

Fixed nits.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 11, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Oct 11, 2018

📌 Commit e4154998576017fcc966b20cf17689aaf6d12ba2 has been approved by oli-obk

@RalfJung
Copy link
Member Author

Oh dang, miri's test suite fails with full MIR. Investigating.

@RalfJung
Copy link
Member Author

This should fix it.

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Oct 11, 2018

📌 Commit 752034d2e98c66d4cf6243d8f895915a1883f5d5 has been approved by oli-obk

@oli-obk
Copy link
Contributor

oli-obk commented Oct 12, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Oct 12, 2018

📌 Commit a7a53f7ffffe596101f93af35f9172641daca1cd has been approved by oli-obk

@bors

This comment has been minimized.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 13, 2018
@RalfJung
Copy link
Member Author

Fixed conflicts.

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Oct 13, 2018

📌 Commit 6426cbe 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 13, 2018
@bors
Copy link
Contributor

bors commented Oct 13, 2018

⌛ Testing commit 6426cbe with merge 2d81989...

bors added a commit that referenced this pull request Oct 13, 2018
miri engine: Fix run-time validation

This fixes all false positives that came up when actually enabling this in miri.

r? @oli-obk
@bors
Copy link
Contributor

bors commented Oct 13, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: oli-obk
Pushing 2d81989 to master...

@bors bors merged commit 6426cbe into rust-lang:master Oct 13, 2018
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #54955!

Tested on commit 2d81989.
Direct link to PR: #54955

🎉 miri on windows: build-fail → test-pass.
🎉 miri on linux: build-fail → test-pass.

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Oct 13, 2018
Tested on commit rust-lang/rust@2d81989.
Direct link to PR: <rust-lang/rust#54955>

🎉 miri on windows: build-fail → test-pass.
🎉 miri on linux: build-fail → test-pass.
@RalfJung RalfJung deleted the miri-validate2 branch October 13, 2018 14:04
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.

4 participants