diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-07-29 11:42:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-29 11:42:34 +0200 |
| commit | eb8114bad75b451a600d3c26c2ee650fc17119c5 (patch) | |
| tree | 37250b56816cdf2cb4ab30c5a889449d64c44d97 /compiler/rustc_pattern_analysis/src | |
| parent | 7e6943d67fdb5ed7428a6cd033b5cfb6907e17da (diff) | |
| parent | f8ebe8d783e20c44508fab32b708f1b9d9a4bf13 (diff) | |
| download | rust-eb8114bad75b451a600d3c26c2ee650fc17119c5.tar.gz rust-eb8114bad75b451a600d3c26c2ee650fc17119c5.zip | |
Rollup merge of #128277 - RalfJung:offset_from_wildcard, r=oli-obk
miri: fix offset_from behavior on wildcard pointers offset_from wouldn't behave correctly when the "end" pointer was a wildcard pointer (result of an int2ptr cast) just at the end of the allocation. Fix that by expressing the "same allocation" check in terms of two `check_ptr_access_signed` instead of something specific to offset_from, which is both more canonical and works better with wildcard pointers. The second commit just improves diagnostics: I wanted the "pointer is dangling (has no provenance)" message to say how many bytes of memory it expected to see (since if it were 0 bytes, this would actually be legal, so it's good to tell the user that it's not 0 bytes). And then I was annoying that the error looks so different for when you deref a dangling pointer vs an out-of-bounds pointer so I made them more similar. Fixes https://github.com/rust-lang/miri/issues/3767
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions
