From 03e1fedfaad36cdf754ac26341a055dfa015292e Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 14 Nov 2019 18:55:41 +0000 Subject: [PATCH] pgen.c, rand.c: Check correct variable when rejecting delete operations. --- pgen.c | 2 +- rand.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pgen.c b/pgen.c index a77c88b..afeeb33 100644 --- a/pgen.c +++ b/pgen.c @@ -424,7 +424,7 @@ static int peset_x(PyObject *me, PyObject *xobj, void *hunoz) mp *x = 0; pgen_event *ev = PGEVENT_EV(me); int rc = -1; - if (!x) NIERR("__del__"); + if (!xobj) NIERR("__del__"); PGEVENT_CHECK(me); if ((x = getmp(xobj)) == 0) goto end; mp_drop(ev->m); diff --git a/rand.c b/rand.c index eeece65..7e091b0 100644 --- a/rand.c +++ b/rand.c @@ -1249,7 +1249,7 @@ static PyObject *bbsget_x(PyObject *me, void *hunoz) static int bbsset_x(PyObject *me, PyObject *val, void *hunoz) { - mp *x = 0; grand *r = GRAND_R(me); int rc = -1; if (!x) NIERR("__del__"); + mp *x = 0; grand *r = GRAND_R(me); int rc = -1; if (!val) NIERR("__del__"); if ((x = getmp(val)) == 0) goto end; r->ops->misc(r, BBS_SET, x); rc = 0; end: mp_drop(x); return (rc); } -- 2.11.0