pgen.c, rand.c: Check correct variable when rejecting delete operations.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 14 Nov 2019 18:55:41 +0000 (18:55 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 22 Nov 2019 22:18:11 +0000 (22:18 +0000)
pgen.c
rand.c

diff --git a/pgen.c b/pgen.c
index a77c88b..afeeb33 100644 (file)
--- 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 (file)
--- 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);
 }