diff --git a/include/pocketpy/vm.h b/include/pocketpy/vm.h index 283c3f30..6aa0ad1f 100644 --- a/include/pocketpy/vm.h +++ b/include/pocketpy/vm.h @@ -364,9 +364,9 @@ public: } Type _tp(PyObject* obj){ + if(!is_tagged(obj)) return obj->type; if(is_int(obj)) return tp_int; - if(is_float(obj)) return tp_float; - return obj->type; + return tp_float; } PyObject* _t(PyObject* obj){ diff --git a/src/vm.cpp b/src/vm.cpp index 004bd122..ad50a961 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -882,25 +882,6 @@ PyObject* VM::vectorcall(int ARGC, int KWARGC, bool op_call){ PyObject** _base = args.begin(); PyObject* buffer[PK_MAX_CO_VARNAMES]; - if(callable_t == tp_native_func){ - const auto& f = PK_OBJ_GET(NativeFunc, callable); - PyObject* ret; - if(f.decl != nullptr){ - int co_nlocals = f.decl->code->varnames.size(); - _prepare_py_call(buffer, args, kwargs, f.decl); - // copy buffer back to stack - s_data.reset(_base + co_nlocals); - for(int j=0; jcode->varnames.size(); + _prepare_py_call(buffer, args, kwargs, f.decl); + // copy buffer back to stack + s_data.reset(_base + co_nlocals); + for(int j=0; j