From 3f9ad7cefc652c7c01a22891250e81194c63064f Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Fri, 6 Sep 2024 16:58:08 -0700 Subject: [PATCH] Add a debug assertion --- src/string_mutable.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/string_mutable.zig b/src/string_mutable.zig index 02ac07cbb3..c894eaf2e9 100644 --- a/src/string_mutable.zig +++ b/src/string_mutable.zig @@ -45,6 +45,7 @@ pub const MutableString = struct { } pub fn write(self: *MutableString, bytes: anytype) !usize { + bun.debugAssert(bytes.len == 0 or !bun.isSliceInBuffer(bytes, self.list.allocatedSlice())); try self.list.appendSlice(self.allocator, bytes); return bytes.len; }