mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-04 03:07:25 +00:00

interpret, miri: fix dealing with overflow during slice indexing and allocation This is mostly to fix https://github.com/rust-lang/rust/issues/130284. I then realized we're using somewhat sketchy arguments for a similar multiplication in `copy`/`copy_nonoverlapping`/`write_bytes`, so I made them all share the same function that checks exactly the right thing. (The intrinsics would previously fail on allocations larger than `1 << 47` bytes... which are theoretically possible maybe? Anyway it seems conceptually wrong to use any other bound than `isize::MAX` here.)