mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-23 13:00:17 +00:00
remove PK_UNREACHABLE()
This commit is contained in:
parent
23bacf8b4d
commit
17de5b3024
@ -37,7 +37,6 @@ static cJSON* convert_python_object_to_cjson(PyVar obj, VM* vm){
|
||||
default: break;
|
||||
}
|
||||
vm->TypeError(_S("unrecognized type ", _type_name(vm, obj_t).escape()));
|
||||
PK_UNREACHABLE()
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,7 +135,6 @@ struct Array2d{
|
||||
return new_array_obj;
|
||||
}
|
||||
vm->TypeError("expected `tuple[int, int]` or `tuple[slice, slice]` as index");
|
||||
PK_UNREACHABLE();
|
||||
});
|
||||
|
||||
vm->bind__setitem__(PK_OBJ_GET(Type, type), [](VM* vm, PyVar _0, PyVar _1, PyVar _2){
|
||||
|
@ -141,7 +141,6 @@ namespace pkpy{
|
||||
return index;
|
||||
}
|
||||
}
|
||||
PK_UNREACHABLE()
|
||||
}
|
||||
|
||||
int CodeEmitContext::add_func_decl(FuncDecl_ decl){
|
||||
|
@ -24,7 +24,6 @@ PyVar PyArrayGetItem(VM* vm, PyVar _0, PyVar _1){
|
||||
return VAR(T(std::move(new_list)));
|
||||
}
|
||||
vm->TypeError("indices must be integers or slices");
|
||||
PK_UNREACHABLE()
|
||||
}
|
||||
|
||||
void __init_builtins(VM* _vm) {
|
||||
@ -1317,7 +1316,6 @@ void __init_builtins(VM* _vm) {
|
||||
vm->TypeError("dict() takes a dictionary or a list of tuples");
|
||||
}
|
||||
vm->TypeError("dict() takes at most 1 argument");
|
||||
PK_UNREACHABLE()
|
||||
});
|
||||
|
||||
_vm->bind__len__(VM::tp_dict, [](VM* vm, PyVar _0) {
|
||||
|
@ -133,7 +133,6 @@ namespace pkpy{
|
||||
return ArgsView(tuple.begin(), tuple.end());
|
||||
}
|
||||
TypeError(_S("expected list or tuple, got ", _type_name(this, _tp(obj)).escape()));
|
||||
PK_UNREACHABLE();
|
||||
}
|
||||
|
||||
void VM::set_main_argv(int argc, char** argv){
|
||||
@ -550,7 +549,6 @@ i64 VM::py_hash(PyVar obj){
|
||||
}
|
||||
if(has_custom_eq){
|
||||
TypeError(_S("unhashable type: ", ti->name.escape()));
|
||||
PK_UNREACHABLE()
|
||||
}else{
|
||||
return obj.hash();
|
||||
}
|
||||
@ -1182,7 +1180,6 @@ PyVar VM::vectorcall(int ARGC, int KWARGC, bool op_call){
|
||||
return vectorcall(ARGC, KWARGC, op_call);
|
||||
}
|
||||
TypeError(_type_name(vm, callable_t).escape() + " object is not callable");
|
||||
PK_UNREACHABLE()
|
||||
}
|
||||
|
||||
void VM::delattr(PyVar _0, StrName _name){
|
||||
@ -1714,7 +1711,6 @@ void VM::__breakpoint(){
|
||||
}
|
||||
if(line == "q" || line == "quit") {
|
||||
vm->RuntimeError("pdb quit");
|
||||
PK_UNREACHABLE()
|
||||
}
|
||||
if(line == "n" || line == "next"){
|
||||
vm->_next_breakpoint = NextBreakpoint(vm->callstack.size(), frame_0->curr_lineno(), false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user