diff options
author | 2023-01-27 14:49:00 -0800 | |
---|---|---|
committer | 2023-01-27 14:49:12 -0800 | |
commit | 0147647e06e1abaae7449369b45c95f9c359bd55 (patch) | |
tree | 37b35453c3708a107a2dff0afc1919b5fccbf5a2 | |
parent | ec010e4930c97c3b70a014ba680385e664a75a28 (diff) | |
download | bun-0147647e06e1abaae7449369b45c95f9c359bd55.tar.gz bun-0147647e06e1abaae7449369b45c95f9c359bd55.tar.zst bun-0147647e06e1abaae7449369b45c95f9c359bd55.zip |
fix sentinel slice
-rw-r--r-- | src/bun.js/node/types.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bun.js/node/types.zig b/src/bun.js/node/types.zig index 79e55d8c7..9eb9224fa 100644 --- a/src/bun.js/node/types.zig +++ b/src/bun.js/node/types.zig @@ -580,7 +580,8 @@ pub const PathLike = union(Tag) { pub inline fn sliceZAssume( this: PathLike, ) [:0]const u8 { - return this.slice()[0.. :0]; + var sliced = this.slice(); + return sliced.ptr[0..sliced.len :0]; } pub fn toJS(this: PathLike, ctx: JSC.C.JSContextRef, exception: JSC.C.ExceptionRef) JSC.C.JSValueRef { |