Skip to content

Commit f738712

Browse files
Handle the case when arraystruct->meminfo is null to close gh-965
1 parent e3323ee commit f738712

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

numba_dpex/core/runtime/_dpexrt_python.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,13 @@ DPEXRT_sycl_usm_ndarray_to_python_acqref(arystruct_t *arystruct,
959959
}
960960
Py_DECREF(args);
961961
}
962+
else {
963+
PyErr_Format(PyExc_ValueError,
964+
"In 'DPEXRT_sycl_usm_ndarray_to_python_acqref', "
965+
"failed to create a new MemInfoObject object since "
966+
"meminfo field was null");
967+
return MOD_ERROR_VAL;
968+
}
962969

963970
shape = arystruct->shape_and_strides;
964971

0 commit comments

Comments
 (0)