rust-lang / miri

An interpreter for Rust's mid-level intermediate representation
Apache License 2.0
4.16k stars 318 forks source link

Detect UB due to mismatching declarations? #3581

Open RalfJung opened 1 month ago

RalfJung commented 1 month ago

This code has UB that Miri does not detect. See https://github.com/rust-lang/rust/issues/46188 for context.

It seems quite hard to detect this though... we have to somehow check all declarations of all no_mangle functions that ever get called, or something like that.

RalfJung commented 1 month ago

Actually... probably this is a rustc bug, and the code shouldn't be UB in the first place.