mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Don't try to free empty strings
This commit is contained in:
parent
ef258fe675
commit
505ade3282
1 changed files with 1 additions and 1 deletions
|
@ -77,7 +77,7 @@ const RocStr = extern struct {
|
|||
}
|
||||
|
||||
pub fn deinit(self: RocStr, allocator: *Allocator) void {
|
||||
if (!self.isSmallStr()) {
|
||||
if (!self.isSmallStr() and !self.isEmpty()) {
|
||||
const strBytesPtr: [*]u8 = self.bytesPtr orelse unreachable;
|
||||
|
||||
const strBytes: []u8 = strBytesPtr[0..self.bytesCount];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue