~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
utils.c: Raise exceptions from `convTHING' with null arguments.
[catacomb-python]
/
util.c
diff --git
a/util.c
b/util.c
index
8a0c06c
..
8fab0bf
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-60,6
+60,7
@@
int convulong(PyObject *o, void *pp)
unsigned long *p = pp;
PyObject *t;
unsigned long *p = pp;
PyObject *t;
+ if (!o) VALERR("can't delete");
if (PyInt_Check(o)) {
i = PyInt_AS_LONG(o);
if (i < 0) VALERR("must be nonnegative");
if (PyInt_Check(o)) {
i = PyInt_AS_LONG(o);
if (i < 0) VALERR("must be nonnegative");
@@
-131,8
+132,11
@@
end:
int convbool(PyObject *o, void *pp)
{
int convbool(PyObject *o, void *pp)
{
+ if (!o) VALERR("can't delete");
*(int *)pp = PyObject_IsTrue(o);
return (1);
*(int *)pp = PyObject_IsTrue(o);
return (1);
+end:
+ return (0);
}
/*----- Type messing ------------------------------------------------------*/
}
/*----- Type messing ------------------------------------------------------*/
@@
-413,7
+417,7
@@
PySequenceMethods gmap_pysequence = {
0 /* @sq_inplace_repeat@ */
};
0 /* @sq_inplace_repeat@ */
};
-
in
t gmap_pysize(PyObject *me)
+
Py_ssize_
t gmap_pysize(PyObject *me)
{
PyObject *i = 0, *x = 0;
int rc = -1;
{
PyObject *i = 0, *x = 0;
int rc = -1;