diff --git a/src/gc.c b/src/gc.c
index fd1817ce919a55c459ba9f597570fb04768b33e7..ac9052458c18d08f74d6981e4fe0722205e72960 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: gc.c,v 1.260 2004/09/28 16:56:00 mast Exp $
+|| $Id: gc.c,v 1.261 2004/09/30 12:12:10 mast Exp $
 */
 
 #include "global.h"
@@ -2438,7 +2438,7 @@ live_recurse:
     /* A thing previously popped as dead is now being marked live.
      * Have to remove the extra ref added by gc_cycle_pop(). */
     gc_free_extra_ref(x);
-    if (!--*(INT32 *) x) {
+    if (!sub_ref ((struct ref_dummy *) x)) {
 #ifdef PIKE_DEBUG
       gc_fatal(x, 0, "Thing got zero refs after removing the dead gc ref.\n");
 #endif
@@ -2605,7 +2605,7 @@ int gc_do_free(void *a)
 	return 1;
       else {
 	gc_free_extra_ref (a);
-	--*(INT32 *) a;
+	sub_ref ((struct ref_dummy *) a);
       }
     }
     return 0;