You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnprotectme(_x:&mut(),y:*mutu8){let y = unsafe{Box::from_raw(y)};drop(y)}fnmain(){let y = Box::new(42u8);let y = Box::leak(y);let x = unsafe{&mut*(y as*mutu8as*mut())};protectme(x, y);}
The deallocation of the Box in protectme is currently reported as UB by Tree Borrows (but not by SB) because of the protector on _x. However, this protector is zero-sized (no offset have yet been accessed) so it's not actually protecting anything. It should not prevent the deallocation.