Commit b9e9bfa9 authored by Guido van Rossum's avatar Guido van Rossum

Removed redundant prototype for err_nomem().

Added check for negative refcnt in DELREF.
parent 624e20ca
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment