Skip to content

Commit 98d4f3b

Browse files
committed
CallFunctionObjArgs should end with NULL as last argument
1 parent aafa6f1 commit 98d4f3b

File tree

1 file changed

+3
-2
lines changed
  • graalpython/com.oracle.graal.python.cext/src

1 file changed

+3
-2
lines changed

graalpython/com.oracle.graal.python.cext/src/object.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,9 @@ PyObject* PyObject_CallFunction(PyObject* callable, const char* fmt, ...) {
532532
}
533533

534534
PyObject* PyObject_CallFunctionObjArgs(PyObject *callable, ...) {
535-
PyObject* args = PyTuple_New(polyglot_get_arg_count() - 1);
536-
for (int i = 1; i < polyglot_get_arg_count(); i++) {
535+
// the arguments are given as a variable list followed by NULL
536+
PyObject* args = PyTuple_New(polyglot_get_arg_count() - 2);
537+
for (int i = 1; i < polyglot_get_arg_count() - 1; i++) {
537538
PyTuple_SetItem(args, i - 1, polyglot_get_arg(i));
538539
}
539540
return PyObject_CallObject(callable, args);

0 commit comments

Comments
 (0)