mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
Merge pull request #2499 from rtfeldman/ident-str-drop
Fix invalid memory access in IdentStr Drop impl
This commit is contained in:
commit
e2da2e86c2
1 changed files with 1 additions and 1 deletions
|
@ -311,7 +311,7 @@ impl Clone for IdentStr {
|
|||
|
||||
impl Drop for IdentStr {
|
||||
fn drop(&mut self) {
|
||||
if !self.is_small_str() {
|
||||
if !self.is_empty() && !self.is_small_str() {
|
||||
unsafe {
|
||||
let align = mem::align_of::<u8>();
|
||||
let layout = Layout::from_size_align_unchecked(self.length, align);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue