]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Removed redundant prototype for err_nomem().
authorGuido van Rossum <guido@python.org>
Fri, 2 Nov 1990 17:49:51 +0000 (17:49 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 2 Nov 1990 17:49:51 +0000 (17:49 +0000)
Added check for negative refcnt in DELREF.

Objects/object.c

index 9f5b6c1e303586ba50ea0137dd635704a1ec2a97..ebeb0f8cf64de009a73aeeb401277fe014860ecd 100644 (file)
@@ -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);