return PyInt_FromLong(0); /* NULL pointer */
typedict = PyType_stgdict(type);
+ assert(typedict); /* Cannot be NULL for pointer types */
/* If we expect POINTER(<type>), but receive a <type> instance, accept
it by calling byref(<type>).
}
ob = PyTuple_GET_ITEM(argtypes, i);
dict = PyType_stgdict(ob);
+ if (dict == NULL) {
+ /* Cannot happen: _validate_paramflags()
+ would not accept such an object */
+ PyErr_Format(PyExc_RuntimeError,
+ "NULL stgdict unexpected");
+ goto error;
+ }
if (PyString_Check(dict->proto)) {
PyErr_Format(
PyExc_TypeError,
assert(stgdict); /* Cannot be NULL for array object instances */
proto = stgdict->proto;
itemdict = PyType_stgdict(proto);
+ assert(itemdict); /* proto is the item type of the array, a ctypes
+ type, so this cannot be NULL */
if (itemdict->getfunc == getentry("c")->getfunc) {
char *ptr = (char *)self->b_ptr;
return PyString_FromStringAndSize(ptr + ilow, len);
proto = stgdict->proto;
assert(proto);
itemdict = PyType_stgdict(proto);
+ assert(itemdict); /* proto is the item type of the pointer, a ctypes
+ type, so this cannot be NULL */
+
size = itemdict->size;
offset = index * itemdict->size;
assert(proto);
itemdict = PyType_stgdict(proto);
+ assert(itemdict); /* Cannot be NULL because the itemtype of a pointer
+ is always a ctypes type */
+
size = itemdict->size;
offset = index * itemdict->size;