aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/terminal/ref_counted_set.zig
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-07-16 23:28:05 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-07-16 23:29:28 +0300
commit4a3302d19a2baa3a33e910e0088c24e780905b90 (patch)
treedcaf76fae1c82102d933c9225b17ca7ac5d3a847 /vendor/libghostty-vt/src/terminal/ref_counted_set.zig
parent550e9f8cc085f428429f5cf2da0bb2dba897e8b8 (diff)
chore: update vendored libghostty-vt
refs #276
Diffstat (limited to 'vendor/libghostty-vt/src/terminal/ref_counted_set.zig')
-rw-r--r--vendor/libghostty-vt/src/terminal/ref_counted_set.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/src/terminal/ref_counted_set.zig b/vendor/libghostty-vt/src/terminal/ref_counted_set.zig
index 8040039a..dd76079f 100644
--- a/vendor/libghostty-vt/src/terminal/ref_counted_set.zig
+++ b/vendor/libghostty-vt/src/terminal/ref_counted_set.zig
@@ -497,6 +497,15 @@ pub fn RefCountedSet(
return self.lookupContext(base, value, self.context);
}
pub fn lookupContext(self: *const Self, base: anytype, value: T, ctx: Context) ?Id {
+ // A zero-capacity set (a valid special case of Layout.init)
+ // contains nothing and has a zero-size table, so we can't
+ // probe it: table[0] would read whatever memory follows the
+ // set in the backing buffer.
+ if (self.layout.table_cap == 0) {
+ @branchHint(.cold);
+ return null;
+ }
+
const table = self.table.ptr(base);
const items = self.items.ptr(base);