summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1990-11-02 17:49:51 (GMT)
committerGuido van Rossum <guido@python.org>1990-11-02 17:49:51 (GMT)
commitbd3edc8dc39692653cdbdfdace620997a53b10bd (patch)
tree0b39c209a314d7b92e0be81e278874d5e117d0a6 /Objects/object.c
parentbe5ea2337413f0df95efcbb773a137f9b696635c (diff)
downloadcpython-bd3edc8dc39692653cdbdfdace620997a53b10bd.zip
cpython-bd3edc8dc39692653cdbdfdace620997a53b10bd.tar.gz
cpython-bd3edc8dc39692653cdbdfdace620997a53b10bd.tar.bz2
Removed redundant prototype for err_nomem().
Added check for negative refcnt in DELREF.
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 9f5b6c1..ebeb0f8 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);