Skip to content

Commit 8aa88c0

Browse files
kesmit13claude
andcommitted
Fix missing PyErr_Occurred checks in call_function_accel
Add PyErr_Occurred() checks after PyLong_AsLong calls for colspec type and return type parsing in call_function_accel. Without these checks, a non-integer value would cause PyLong_AsLong to return -1 and set the error indicator, but the code would silently continue with -1 as the type code. This matches the existing pattern used in the other accel functions (call_function_rowdat_1, call_function_rowdat_1_to_pylist). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2753f6e commit 8aa88c0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

accel.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4855,6 +4855,7 @@ static PyObject *call_function_accel(PyObject *self, PyObject *args, PyObject *k
48554855
if (!py_ctype) { Py_DECREF(py_cspec); goto error; }
48564856
ctypes[i] = (int)PyLong_AsLong(py_ctype);
48574857
Py_DECREF(py_ctype); Py_DECREF(py_cspec);
4858+
if (PyErr_Occurred()) { goto error; }
48584859
}
48594860

48604861
// Parse return types
@@ -4870,6 +4871,7 @@ static PyObject *call_function_accel(PyObject *self, PyObject *args, PyObject *k
48704871
if (!py_item) goto error;
48714872
rtypes[i] = (int)PyLong_AsLong(py_item);
48724873
Py_DECREF(py_item);
4874+
if (PyErr_Occurred()) { goto error; }
48734875
}
48744876

48754877
out_l = 256;

0 commit comments

Comments
 (0)