about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-04-01 06:59:44 +0200
committerGitHub <noreply@github.com>2022-04-01 06:59:44 +0200
commitcdf178f776371bb0320769f95810c3c4fa668404 (patch)
tree36a08f5a44ac652bec46989148e3d43528b79d1c /compiler/rustc_codegen_gcc
parent40be7d3d487ca89460f5298baa4e678a016d39cf (diff)
parentcb0d15b0904aacc8f6106a68e17d234d466a027e (diff)
downloadrust-cdf178f776371bb0320769f95810c3c4fa668404.tar.gz
rust-cdf178f776371bb0320769f95810c3c4fa668404.zip
Rollup merge of #95388 - RalfJung:rust-val-limit, r=oli-obk
interpret: make isize::MAX the limit for dynamic value sizes

We are currently enforcing `data_layout.obj_size_bound()` as the maximal dynamic size of a Rust value (including for `size_of_val_raw`), but that does not match the docs.

In particular, Miri currently falsely says that this code has UB:
```rust
#![feature(layout_for_ptr)]
fn main() {
    let size = isize::MAX as usize;
    // Creating a raw slice of size isize::MAX and asking for its size is okay.
    let s = std::ptr::slice_from_raw_parts(1usize as *const u8, size);
    assert_eq!(size, unsafe { std::mem::size_of_val_raw(s) });
}
```
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions