Fix decref in utils.zig

This commit is contained in:
Richard Feldman 2021-06-17 22:15:54 -04:00
parent b6f0a3f693
commit b7af34c8b1

View file

@ -92,7 +92,7 @@ pub fn decref(
if (refcount == REFCOUNT_ONE_ISIZE) { if (refcount == REFCOUNT_ONE_ISIZE) {
dealloc(bytes - 16, alignment); dealloc(bytes - 16, alignment);
} else if (refcount_isize < 0) { } else if (refcount_isize < 0) {
(isizes - 1)[0] = refcount - 1; (isizes - 1)[0] = refcount + 1;
} }
}, },
else => { else => {
@ -100,7 +100,7 @@ pub fn decref(
if (refcount == REFCOUNT_ONE_ISIZE) { if (refcount == REFCOUNT_ONE_ISIZE) {
dealloc(bytes - 8, alignment); dealloc(bytes - 8, alignment);
} else if (refcount_isize < 0) { } else if (refcount_isize < 0) {
(isizes - 1)[0] = refcount - 1; (isizes - 1)[0] = refcount + 1;
} }
}, },
} }