This commit is contained in:
blueloveTH 2024-05-18 17:51:09 +08:00
parent db725f8b5f
commit 0c9e49a30d
2 changed files with 3 additions and 2 deletions

View File

@ -172,6 +172,7 @@ obj_get_t<T> PyVar::obj_get(){
if constexpr(is_sso_v<T>){
return as<T>();
}else{
PK_DEBUG_ASSERT(!is_sso)
return ((Py_<T>*)(_1))->_value;
}
}

View File

@ -999,14 +999,14 @@ PyVar VM::vectorcall(int ARGC, int KWARGC, bool op_call){
PyVar* p0 = p1 - ARGC - 2;
// [callable, <self>, args..., kwargs...]
// ^p0 ^p1 ^_sp
PyVar callable = p1[-(ARGC + 2)];
PyVar callable = p1[-ARGC-2];
Type callable_t = _tp(callable);
int method_call = p0[1] != PY_NULL;
// handle boundmethod, do a patch
if(callable_t == tp_bound_method){
if(method_call) PK_FATAL_ERROR();
PK_DEBUG_ASSERT(!method_call)
BoundMethod& bm = PK_OBJ_GET(BoundMethod, callable);
callable = bm.func; // get unbound method
callable_t = _tp(callable);