Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bd3edc8

Browse files
committed
Removed redundant prototype for err_nomem().
Added check for negative refcnt in DELREF.
1 parent be5ea23 commit bd3edc8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Objects/object.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
#include "objimpl.h"
99
#include "errors.h"
1010

11-
extern object *err_nomem PROTO((void)); /* XXX from modsupport.c */
12-
1311
int StopPrint; /* Flag to indicate printing must be stopped */
1412

1513
/* Object allocation routines used by NEWOBJ and NEWVAROBJ macros */
@@ -175,6 +173,10 @@ NEWREF(op)
175173
DELREF(op)
176174
object *op;
177175
{
176+
if (op->ob_refcnt < 0) {
177+
fprintf(stderr, "negative refcnt\n");
178+
abort();
179+
}
178180
op->_ob_next->_ob_prev = op->_ob_prev;
179181
op->_ob_prev->_ob_next = op->_ob_next;
180182
(*(op)->ob_type->tp_dealloc)(op);

0 commit comments

Comments
 (0)