fmt
This commit is contained in:
parent
85ed3fe55d
commit
fc260e163a
@ -673,7 +673,8 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> {
|
||||
// attempt to use it for a non-zero-sized access.
|
||||
// Dangling slices are a common case here; it's valid to get their length but with raw
|
||||
// pointer tagging for example all calls to get_unchecked on them are invalid.
|
||||
if let Ok((alloc_id, base_offset, orig_tag)) = this.ptr_try_get_alloc_id(place.ptr(), 0) {
|
||||
if let Ok((alloc_id, base_offset, orig_tag)) = this.ptr_try_get_alloc_id(place.ptr(), 0)
|
||||
{
|
||||
log_creation(this, Some((alloc_id, base_offset, orig_tag)))?;
|
||||
// Still give it the new provenance, it got retagged after all.
|
||||
return Ok(Some(Provenance::Concrete { alloc_id, tag: new_tag }));
|
||||
|
@ -81,8 +81,10 @@ impl<'tcx> UnixEnvVars<'tcx> {
|
||||
return Ok(None);
|
||||
};
|
||||
// The offset is used to strip the "{name}=" part of the string.
|
||||
let var_ptr = var_ptr
|
||||
.wrapping_offset(Size::from_bytes(u64::try_from(name.len()).unwrap().strict_add(1)), ecx);
|
||||
let var_ptr = var_ptr.wrapping_offset(
|
||||
Size::from_bytes(u64::try_from(name.len()).unwrap().strict_add(1)),
|
||||
ecx,
|
||||
);
|
||||
Ok(Some(var_ptr))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user