-
Notifications
You must be signed in to change notification settings - Fork 13.4k
miri: better ptr-out-of-bounds errors #87224
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
Conversation
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
This comment has been minimized.
This comment has been minimized.
I don't think it is possible to trigger the negative case in CTFE, but it is possible in Miri: rust-lang/miri#1853. |
well... we can run the same code in CTFE: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=6670eb77e14af454abf6f33d1523f4b2 ... but the error message is absolutely useless:
I don't know how this happened, it sounds to me like the intrinsic call is treated as a separate const evaluation? |
The same test as CTFE doesn't work since But I found a test that works. :)
The actual error span is inside the |
because we don't have the libcore source available. we should still print messages, even if the source of a span is missing. probably will get solved when we put the error message as the main message, instead of a label |
@bors r+ |
📌 Commit bed3b96 has been approved by |
☀️ Test successful - checks-actions |
Tested on commit rust-lang/rust@718d53b. Direct link to PR: <rust-lang/rust#87224> 💔 miri on windows: test-fail → build-fail (cc @oli-obk @RalfJung @eddyb). 💔 miri on linux: test-fail → build-fail (cc @oli-obk @RalfJung @eddyb).
better errors for negative out-of-bounds offsets This is the Miri side of rust-lang/rust#87224
For offsets larger than
isize::MAX
, display them as negative offsets.r? @oli-obk