File 563.patch of Package libdispatch
From 729e25d92d05a8c4a8136e831ec6123bbf7f2654 Mon Sep 17 00:00:00 2001
From: Evan Wilde <ewilde@apple.com>
Date: Thu, 19 Aug 2021 11:57:34 -0700
Subject: [PATCH] Removing unused refcount variable
The rebranch branch is failing to build due to an unused refcount
variable in runtime.c. The variable is only used by an os_assert and
nowhere else. I've removed it and instead put the check directly in the
assert.
---
src/BlocksRuntime/runtime.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/BlocksRuntime/runtime.c b/src/BlocksRuntime/runtime.c
index bfec1a0bf..4b7d4bfa2 100644
--- a/src/BlocksRuntime/runtime.c
+++ b/src/BlocksRuntime/runtime.c
@@ -468,18 +468,16 @@ static void _Block_byref_assign_copy(void *dest, const void *arg, const int flag
// Old compiler SPI
static void _Block_byref_release(const void *arg) {
struct Block_byref *byref = (struct Block_byref *)arg;
- int32_t refcount;
// dereference the forwarding pointer since the compiler isn't doing this anymore (ever?)
byref = byref->forwarding;
-
+
// To support C++ destructors under GC we arrange for there to be a finalizer for this
// by using an isa that directs the code to a finalizer that calls the byref_destroy method.
if ((byref->flags & BLOCK_BYREF_NEEDS_FREE) == 0) {
return; // stack or GC or global
}
- refcount = byref->flags & BLOCK_REFCOUNT_MASK;
- os_assert(refcount);
+ os_assert(byref->flags & BLOCK_REFCOUNT_MASK);
if (latching_decr_int_should_deallocate(&byref->flags)) {
if (byref->flags & BLOCK_BYREF_HAS_COPY_DISPOSE) {
struct Block_byref_2 *byref2 = (struct Block_byref_2 *)(byref+1);