blueloveTH 1 year ago
parent
commit
a4f186057d
2 changed files with 1 additions and 3 deletions
  1. 1 1
      include/pocketpy/pocketpy.h
  2. 0 2
      src/public/internal.c

+ 1 - 1
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

+ 0 - 2
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;
     }
 }