mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
some fix
This commit is contained in:
parent
bc640e503c
commit
0fd2c695bf
@ -948,24 +948,22 @@ __FAST_CALL:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(is_non_tagged_type(callable, tp_type)){
|
if(is_non_tagged_type(callable, tp_type)){
|
||||||
if(method_call) PK_FATAL_ERROR();
|
|
||||||
// [type, NULL, args..., kwargs...]
|
// [type, NULL, args..., kwargs...]
|
||||||
PyObject* new_f = find_name_in_mro(PK_OBJ_GET(Type, callable), __new__);
|
PyObject* new_f = find_name_in_mro(PK_OBJ_GET(Type, callable), __new__);
|
||||||
PyObject* obj;
|
PyObject* obj;
|
||||||
#if PK_DEBUG_EXTRA_CHECK
|
#if PK_DEBUG_EXTRA_CHECK
|
||||||
PK_ASSERT(new_f != nullptr);
|
PK_ASSERT(new_f != nullptr && !method_call);
|
||||||
#endif
|
#endif
|
||||||
if(new_f == cached_object__new__) {
|
if(new_f == cached_object__new__) {
|
||||||
// fast path for object.__new__
|
// fast path for object.__new__
|
||||||
Type t = PK_OBJ_GET(Type, callable);
|
obj = vm->heap.gcnew<DummyInstance>(PK_OBJ_GET(Type, callable));
|
||||||
obj = vm->heap.gcnew<DummyInstance>(t);
|
|
||||||
}else{
|
}else{
|
||||||
PUSH(new_f);
|
PUSH(new_f);
|
||||||
PUSH(PY_NULL);
|
PUSH(PY_NULL);
|
||||||
PUSH(callable); // cls
|
PUSH(callable); // cls
|
||||||
for(PyObject* o: args) PUSH(o);
|
for(PyObject* o: args) PUSH(o);
|
||||||
for(PyObject* o: kwargs) PUSH(o);
|
for(PyObject* o: kwargs) PUSH(o);
|
||||||
// if obj is not an instance of callable, the behavior is undefined
|
// if obj is not an instance of `cls`, the behavior is undefined
|
||||||
obj = vectorcall(ARGC+1, KWARGC);
|
obj = vectorcall(ARGC+1, KWARGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user