From b7af34c8b1ca80558918f3fd05090faef6d5eed8 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Thu, 17 Jun 2021 22:15:54 -0400 Subject: [PATCH] Fix decref in utils.zig --- compiler/builtins/bitcode/src/utils.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/builtins/bitcode/src/utils.zig b/compiler/builtins/bitcode/src/utils.zig index be99cab009..197c5d182f 100644 --- a/compiler/builtins/bitcode/src/utils.zig +++ b/compiler/builtins/bitcode/src/utils.zig @@ -92,7 +92,7 @@ pub fn decref( if (refcount == REFCOUNT_ONE_ISIZE) { dealloc(bytes - 16, alignment); } else if (refcount_isize < 0) { - (isizes - 1)[0] = refcount - 1; + (isizes - 1)[0] = refcount + 1; } }, else => { @@ -100,7 +100,7 @@ pub fn decref( if (refcount == REFCOUNT_ONE_ISIZE) { dealloc(bytes - 8, alignment); } else if (refcount_isize < 0) { - (isizes - 1)[0] = refcount - 1; + (isizes - 1)[0] = refcount + 1; } }, }