-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
rustc crashed when compiling the crafted input #81827
Comments
I am not sure whether it is a security-oriented bug. If so, please close this. But I guess it is ok to be public. Thanks. |
This is an explicit
So just an ICE, just somebody used an |
rust/compiler/rustc_ast/src/mut_visit.rs Lines 303 to 304 in 9a1d617
is the |
The problem is that the The stack looks something like this:
Two potential fixes here: adjust I think this is probably P-medium or thereabouts. |
It seems like the implementation of |
Would this be safe? My understanding is if the callback panics then the pointer will potentially be in an inconsistent state and continuing execution will not be safe. |
Well, not in the exact form it is now, but there are a couple avenues that could be explored to make it more resilient to closure panics – e.g. one could replace the old value with some sort of placeholder default while the original value is being processed. |
Another test-case. Hope it can help. fn a() {
({
#[cfg(for (b +] 0 |
Assigning |
No longer crashes due to #91519 |
I think this issue is more than an internal compiler error, so I report here.
I tried this code:
The md5 of poc.rs is: 55d1b05bebbe11b76ee62fe193bdd5ff
I expected to see this happen: normal compilation
Instead, this happened: rustc crashes
Meta
I test it on nightly, beta, and stable versions.
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: