mirror of
https://github.com/pocketpy/pocketpy
synced 2025-12-09 03:30:17 +00:00
fix a bug
This commit is contained in:
parent
450b7e1e3c
commit
468f7a3c22
2
src/vm.h
2
src/vm.h
@ -1015,7 +1015,7 @@ inline PyObject* VM::_py_call(PyObject** p0, PyObject* callable, ArgsView args,
|
||||
|
||||
// if this function is simple, a.k.a, no kwargs and no *args and not a generator
|
||||
// we can use a fast path to avoid using buffer copy
|
||||
if(fn.is_simple){
|
||||
if(fn.is_simple && kwargs.size()==0){
|
||||
if(args.size() > fn.decl->args.size()) TypeError("too many positional arguments");
|
||||
int spaces = co->varnames.size() - fn.decl->args.size();
|
||||
for(int j=0; j<spaces; j++) PUSH(nullptr);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user