mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-08-17 03:50:21 +03:00
Prevent GraphemeStrs created from Strings from leaking (#7920)
This commit is contained in:
parent
ee3171cc54
commit
01776e6851
@ -481,7 +481,7 @@ fn from(g: String) -> Self {
|
||||
let ptr = Box::into_raw(g.into_bytes().into_boxed_slice()) as *mut u8;
|
||||
GraphemeStr {
|
||||
ptr: unsafe { NonNull::new_unchecked(ptr) },
|
||||
len: i32::try_from(len).unwrap() as u32,
|
||||
len: (i32::try_from(len).unwrap() as u32) | Self::MASK_OWNED,
|
||||
phantom: PhantomData,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user