File: | plpython.c |
Function: | PLyList_FromArray |
Error: | dereferencing NULL (MEM[(struct PyListObject *)list].ob_item) at plpython.c:2362 |
2326 static PyObject *
2327 PLyList_FromArray(PLyDatumToOb *arg, Datum d)
2328 {
2329 ArrayType *array = DatumGetArrayTypeP(d);
2330 PLyDatumToOb *elm = arg->elm;
when treating unknown struct PLyDatumToOb * from plpython.c:2327 as non-NULL
2331 PyObject *list;
2332 int length;
2333 int lbound;
2334 int i;
2335
2336 if (ARR_NDIM(array) == 0)
when treating unknown struct varlena * from plpython.c:2329 as non-NULL
when considering range: -0x80000000 <= value <= -1
taking False path
2337 return PyList_New(0);
2338
2339 if (ARR_NDIM(array) != 1)
when considering range: -0x80000000 <= value <= 0
taking True path
2340 ereport(ERROR,
when considering range: -128 <= value <= -1
taking True path
2341 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2342 errmsg("cannot convert multidimensional array to Python list"),
2343 errdetail("PL/Python only supports one-dimensional arrays.")));
2344
2345 length = ARR_DIMS(array)[0];
2346 lbound = ARR_LBOUND(array)[0];
when treating unknown int * from plpython.c:2346 as non-NULL
2347 list = PyList_New(length);
when PyList_New() fails
2348
2349 for (i = 0; i < length; i++)
when considering range: 1 <= value <= 0x7fffffff
taking True path
2350 {
2351 Datum elem;
2352 bool isnull;
2353 int offset;
2354
2355 offset = lbound + i;
2356 elem = array_ref(array, 1, &offset, arg->typlen,
2357 elm->typlen, elm->typbyval, elm->typalign,
when treating unknown struct PLyDatumToOb * from plpython.c:2330 as non-NULL
2358 &isnull);
2359 if (isnull)
when taking True path
2360 {
2361 Py_INCREF(Py_None);
2362 PyList_SET_ITEM(list, i, Py_None);
dereferencing NULL (MEM[(struct PyListObject *)list].ob_item) at plpython.c:2362
found 1 similar trace(s) to this
2363 }
2364 else
2365 PyList_SET_ITEM(list, i, elm->func(elm, elem));
2366 }
2367
2368 return list;
2369 }
File: | plpython.c |
Function: | PLyList_FromArray |
Error: | dereferencing NULL (MEM[(struct PyListObject *)list].ob_item) at plpython.c:2365 |
2326 static PyObject *
2327 PLyList_FromArray(PLyDatumToOb *arg, Datum d)
2328 {
2329 ArrayType *array = DatumGetArrayTypeP(d);
2330 PLyDatumToOb *elm = arg->elm;
when treating unknown struct PLyDatumToOb * from plpython.c:2327 as non-NULL
2331 PyObject *list;
2332 int length;
2333 int lbound;
2334 int i;
2335
2336 if (ARR_NDIM(array) == 0)
when treating unknown struct varlena * from plpython.c:2329 as non-NULL
when considering range: -0x80000000 <= value <= -1
taking False path
2337 return PyList_New(0);
2338
2339 if (ARR_NDIM(array) != 1)
when considering range: -0x80000000 <= value <= 0
taking True path
2340 ereport(ERROR,
when considering range: -128 <= value <= -1
taking True path
2341 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
2342 errmsg("cannot convert multidimensional array to Python list"),
2343 errdetail("PL/Python only supports one-dimensional arrays.")));
2344
2345 length = ARR_DIMS(array)[0];
2346 lbound = ARR_LBOUND(array)[0];
when treating unknown int * from plpython.c:2346 as non-NULL
2347 list = PyList_New(length);
when PyList_New() fails
2348
2349 for (i = 0; i < length; i++)
when considering range: 1 <= value <= 0x7fffffff
taking True path
2350 {
2351 Datum elem;
2352 bool isnull;
2353 int offset;
2354
2355 offset = lbound + i;
2356 elem = array_ref(array, 1, &offset, arg->typlen,
2357 elm->typlen, elm->typbyval, elm->typalign,
when treating unknown struct PLyDatumToOb * from plpython.c:2330 as non-NULL
2358 &isnull);
2359 if (isnull)
when taking False path
2360 {
2361 Py_INCREF(Py_None);
2362 PyList_SET_ITEM(list, i, Py_None);
2363 }
2364 else
2365 PyList_SET_ITEM(list, i, elm->func(elm, elem));
dereferencing NULL (MEM[(struct PyListObject *)list].ob_item) at plpython.c:2365
found 1 similar trace(s) to this
2366 }
2367
2368 return list;
2369 }