Skip to content

Commit 9b68b04

Browse files
authored
Merge pull request swiftlang#563 from etcwilde/ewilde/remove-unused-refcount
Removing unused refcount variable
2 parents 7870521 + 729e25d commit 9b68b04

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/BlocksRuntime/runtime.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,18 +468,16 @@ static void _Block_byref_assign_copy(void *dest, const void *arg, const int flag
468468
// Old compiler SPI
469469
static void _Block_byref_release(const void *arg) {
470470
struct Block_byref *byref = (struct Block_byref *)arg;
471-
int32_t refcount;
472471

473472
// dereference the forwarding pointer since the compiler isn't doing this anymore (ever?)
474473
byref = byref->forwarding;
475-
474+
476475
// To support C++ destructors under GC we arrange for there to be a finalizer for this
477476
// by using an isa that directs the code to a finalizer that calls the byref_destroy method.
478477
if ((byref->flags & BLOCK_BYREF_NEEDS_FREE) == 0) {
479478
return; // stack or GC or global
480479
}
481-
refcount = byref->flags & BLOCK_REFCOUNT_MASK;
482-
os_assert(refcount);
480+
os_assert(byref->flags & BLOCK_REFCOUNT_MASK);
483481
if (latching_decr_int_should_deallocate(&byref->flags)) {
484482
if (byref->flags & BLOCK_BYREF_HAS_COPY_DISPOSE) {
485483
struct Block_byref_2 *byref2 = (struct Block_byref_2 *)(byref+1);

0 commit comments

Comments
 (0)