aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src
diff options
context:
space:
mode:
authorDillard Robertson2023-08-13 01:13:06 +0000
committerGitHub2023-08-13 01:13:06 +0000
commit01776e685103032daccbc0d319f0aceed3bb9156 (patch)
tree62ac43c0bf9a30068ccca21673c5d870cd65d89c /helix-core/src
parentee3171cc54052bc8d3569cc04bd9f6a57b43afca (diff)
Prevent GraphemeStrs created from Strings from leaking (#7920)
Diffstat (limited to 'helix-core/src')
-rw-r--r--helix-core/src/graphemes.rs2
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,
}
}