From: Guido van Rossum Date: Fri, 2 Nov 1990 17:49:51 +0000 (+0000) Subject: Removed redundant prototype for err_nomem(). X-Git-Tag: v0.9.8~1125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd3edc8dc39692653cdbdfdace620997a53b10bd;p=thirdparty%2FPython%2Fcpython.git Removed redundant prototype for err_nomem(). Added check for negative refcnt in DELREF. --- diff --git a/Objects/object.c b/Objects/object.c index 9f5b6c1e3035..ebeb0f8cf64d 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -8,8 +8,6 @@ #include "objimpl.h" #include "errors.h" -extern object *err_nomem PROTO((void)); /* XXX from modsupport.c */ - int StopPrint; /* Flag to indicate printing must be stopped */ /* Object allocation routines used by NEWOBJ and NEWVAROBJ macros */ @@ -175,6 +173,10 @@ NEWREF(op) DELREF(op) object *op; { + if (op->ob_refcnt < 0) { + fprintf(stderr, "negative refcnt\n"); + abort(); + } op->_ob_next->_ob_prev = op->_ob_prev; op->_ob_prev->_ob_next = op->_ob_next; (*(op)->ob_type->tp_dealloc)(op);