-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
No check for infinitely sized structs #3779
Comments
Huh, so that's why std::list has pointer indirections in it. |
This is still an issue, nominating for production ready |
accepted for production-ready milestone |
So uh, this... doesn't exactly reproduce. It compiles and runs fine, no overflow or anything afaict. It should be rejected by the compiler, I think. |
This applies to non-infinite-sized types that contain themselves unboxed like the following too: struct Foo { x: [Foo, .. 0] } // possibly ok, size is 0. |
Accepted for 1.0, P-high. |
Replace set_last_error with set_last_error_and_return Took care of the simple patterns. Other patterns involved setting an error and then using `write_int` or setting metadata and returning -1. Unsure if those are in the scope of this change Looks like this has conflicts with rust-lang#3779, so I can update when how to handle that is decided. Part of rust-lang/miri#3930.
The following program causes a stack overflow:
There is a check that enums do not recurse in this way, but no such check for structs. (Note, though, that there is a check that structrs are instantiable, which is slightly different)
The text was updated successfully, but these errors were encountered: