From 0d0261c0698f51fc66e88607e79b5c8079d4b800 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 17 Mar 2024 19:02:04 +0800 Subject: [PATCH] some fix --- src/vm.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/vm.cpp b/src/vm.cpp index 54b679a3..ba59f1db 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -887,13 +887,12 @@ PyObject* VM::vectorcall(int ARGC, int KWARGC, bool op_call){ if(s_data.is_overflow()) StackOverflowError(); const Function& fn = PK_OBJ_GET(Function, callable); - const FuncDecl_& decl = fn.decl; - const CodeObject* co = decl->code.get(); + const CodeObject* co = fn.decl->code.get(); int co_nlocals = co->varnames.size(); - if(decl->is_simple){ - if(args.size() != decl->args.size()){ + if(fn.decl->is_simple){ + if(args.size() != fn.decl->args.size()){ TypeError(_S( - co->name, "() takes ", decl->args.size(), " positional arguments but ", args.size(), " were given" + co->name, "() takes ", fn.decl->args.size(), " positional arguments but ", args.size(), " were given" )); } if(!kwargs.empty()) TypeError(_S(co->name, "() takes no keyword arguments")); @@ -905,7 +904,7 @@ PyObject* VM::vectorcall(int ARGC, int KWARGC, bool op_call){ goto __FAST_CALL; } - _prepare_py_call(buffer, args, kwargs, decl); + _prepare_py_call(buffer, args, kwargs, fn.decl); if(co->is_generator){ s_data.reset(p0);