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 fn ptr check: don't use conservative null check #94343

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

RalfJung
Copy link
Member

In #94270 I used the wrong NULL check for function pointers: memory.ptr_may_be_null is conservative even on machines that support ptr-to-int casts, leading to false errors in Miri.

This fixes that problem, and also replaces that foot-fun of a method with scalar_may_be_null which is never unnecessarily conservative.

r? @oli-obk

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 25, 2022
@rust-highfive
Copy link
Collaborator

Some changes occured to the CTFE / Miri engine

cc @rust-lang/miri

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 25, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Feb 25, 2022

@bors r+ rollup

Oh, yea, that seemed footgunny

@bors
Copy link
Contributor

bors commented Feb 25, 2022

📌 Commit d8064d7 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 Feb 25, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 25, 2022
…askrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#93845 (Remove in band lifetimes)
 - rust-lang#94155 (Extend toggle GUI test a bit)
 - rust-lang#94252 (don't special case `DefKind::Ctor` in encoding)
 - rust-lang#94305 (Remove an unnecessary restriction in `dest_prop`)
 - rust-lang#94343 (Miri fn ptr check: don't use conservative null check)
 - rust-lang#94344 (diagnostic: suggest parens when users want logical ops, but get closures)
 - rust-lang#94352 (Fix SGX docs build)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cf3bb09 into rust-lang:master Feb 25, 2022
@rustbot rustbot added this to the 1.61.0 milestone Feb 25, 2022
@RalfJung RalfJung deleted the fn-ptr branch February 25, 2022 16:54
bors added a commit to rust-lang/miri that referenced this pull request Feb 25, 2022
update fn ptr tests

This adjusts the tests for rust-lang/rust#94343.
bors added a commit to rust-lang/miri that referenced this pull request Feb 27, 2022
update fn ptr tests

This adjusts the tests for rust-lang/rust#94343.
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants