Message46826
Logged In: YES
user_id=908995
Okay, I'll post a cleaned up script this weekend. About your
improvements:
1. Py_CLEAR already has the same semantics as a would-be
Py_XCLEAR--it doesn't do anything if its argument is
null. Py_XDECREF should definitely be checked for,
though.
2. Py_DECREF(x) is probably safe; this is what I meant when
I talked about operating on automatic variables in the
initial comment. The grep for "->" filters out matches
that are safe in this manner. It should be noted that
this isn't necessarily safe, just that it's almost
certainly so. In particular, it's not safe in this case:
PyObject *x = ...;
/* self is a struct { PyObject **something; ... } */
self->something = &x;
Py_DECREF(x);
x = NULL;
but doing that is just insane.
The grep would also miss ((*self).something), but I
didn't expect to see any of those. |
|
Date |
User |
Action |
Args |
2007-08-23 15:39:40 | admin | link | issue1020188 messages |
2007-08-23 15:39:40 | admin | create | |
|