diff --git a/include/pocketpy/pocketpy.h b/include/pocketpy/pocketpy.h index 90e02ae1..86a11547 100644 --- a/include/pocketpy/pocketpy.h +++ b/include/pocketpy/pocketpy.h @@ -594,7 +594,7 @@ PK_API bool py_isidentical(py_Ref, py_Ref); /// Call a function. /// It prepares the stack and then performs a `vectorcall(argc, 0, false)`. /// The result will be set to `py_retval()`. -/// The stack remains unchanged after the operation. +/// The stack remains unchanged if successful. PK_API bool py_call(py_Ref f, int argc, py_Ref argv) PY_RAISE PY_RETURN; #ifndef NDEBUG diff --git a/src/public/internal.c b/src/public/internal.c index d0741faa..59f1a4c0 100644 --- a/src/public/internal.c +++ b/src/public/internal.c @@ -114,13 +114,11 @@ bool py_call(py_Ref f, int argc, py_Ref argv) { if(f->type == tp_nativefunc) { return py_callcfunc(f->_cfunc, argc, argv); } else { - py_StackRef p0 = py_peek(0); py_push(f); py_pushnil(); for(int i = 0; i < argc; i++) py_push(py_offset(argv, i)); bool ok = py_vectorcall(argc, 0); - pk_current_vm->stack.sp = p0; return ok; } }