mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 03:50:16 +00:00
some fix
This commit is contained in:
parent
cef275f900
commit
47463290a6
@ -178,11 +178,7 @@ struct PyVar final{
|
||||
char _bytes[12];
|
||||
|
||||
// uninitialized
|
||||
#if PK_DEBUG_EXTRA_CHECK
|
||||
PyVar(): type() { }
|
||||
#else
|
||||
PyVar() = default;
|
||||
#endif
|
||||
// zero initialized
|
||||
PyVar(std::nullptr_t): type(), is_sso(false), flags(0), _bytes{0} { }
|
||||
// PyObject* initialized (is_sso = false)
|
||||
|
@ -206,7 +206,7 @@ namespace pkpy{
|
||||
}
|
||||
|
||||
PyVar VM::new_type_object(PyVar mod, StrName name, Type base, bool subclass_enabled){
|
||||
PyVar obj = heap._new<Type>(tp_type, Type(_all_types.size()+1));
|
||||
PyVar obj = heap._new<Type>(tp_type, Type(_all_types.size()));
|
||||
const PyTypeInfo& base_info = _all_types[base];
|
||||
if(!base_info.subclass_enabled){
|
||||
Str error = _S("type ", base_info.name.escape(), " is not `subclass_enabled`");
|
||||
@ -825,6 +825,7 @@ void VM::__log_s_data(const char* title) {
|
||||
#endif
|
||||
|
||||
void VM::__init_builtin_types(){
|
||||
_all_types.push_back({nullptr, Type(), nullptr, "", false}); // 0 is not used
|
||||
_all_types.push_back({heap._new<Type>(tp_type, tp_object), Type(), nullptr, "object", true});
|
||||
_all_types.push_back({heap._new<Type>(tp_type, tp_type), tp_object, nullptr, "type", false});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user