This commit is contained in:
blueloveTH 2023-06-19 15:24:09 +08:00
parent 596ecd5c9e
commit c78275428f

View File

@ -1568,6 +1568,7 @@ inline void CodeObjectSerializer::write_object(VM *vm, PyObject *obj){
if(is_int(obj)) write_int(_CAST(i64, obj)); if(is_int(obj)) write_int(_CAST(i64, obj));
else if(is_float(obj)) write_float(_CAST(f64, obj)); else if(is_float(obj)) write_float(_CAST(f64, obj));
else if(is_type(obj, vm->tp_str)) write_str(_CAST(Str&, obj)); else if(is_type(obj, vm->tp_str)) write_str(_CAST(Str&, obj));
else if(is_type(obj, vm->tp_bool)) write_bool(_CAST(bool, obj));
else{ else{
throw std::runtime_error(fmt(OBJ_NAME(vm->_t(obj)).escape(), " is not serializable")); throw std::runtime_error(fmt(OBJ_NAME(vm->_t(obj)).escape(), " is not serializable"));
} }