diff options
author | Dillard Robertson | 2023-08-13 01:13:06 +0000 |
---|---|---|
committer | GitHub | 2023-08-13 01:13:06 +0000 |
commit | 01776e685103032daccbc0d319f0aceed3bb9156 (patch) | |
tree | 62ac43c0bf9a30068ccca21673c5d870cd65d89c | |
parent | ee3171cc54052bc8d3569cc04bd9f6a57b43afca (diff) |
Prevent GraphemeStrs created from Strings from leaking (#7920)
-rw-r--r-- | helix-core/src/graphemes.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-core/src/graphemes.rs b/helix-core/src/graphemes.rs index 15ef3eb0..d9e5e022 100644 --- a/helix-core/src/graphemes.rs +++ b/helix-core/src/graphemes.rs @@ -481,7 +481,7 @@ impl<'a> From<String> for GraphemeStr<'a> { 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, } } |