This commit is contained in:
blueloveTH 2024-01-05 22:49:42 +08:00
parent 866abe2c63
commit 42a7d02286
6 changed files with 8 additions and 8 deletions

View File

@ -49,7 +49,7 @@ static cJSON* convert_python_object_to_cjson(PyObject* obj, VM* vm){
return cJSON_CreateNull();
}
vm->TypeError(fmt("unrecognized type ", obj_type_name(vm, obj_t).escape()));
PK_UNREACHABLE();
PK_UNREACHABLE()
}

View File

@ -66,10 +66,10 @@
#ifdef _MSC_VER
#define PK_ENABLE_COMPUTED_GOTO 0
#define PK_UNREACHABLE() __assume(0)
#define PK_UNREACHABLE() __assume(0);
#else
#define PK_ENABLE_COMPUTED_GOTO 1
#define PK_UNREACHABLE() __builtin_unreachable()
#define PK_UNREACHABLE() __builtin_unreachable();
#endif

View File

@ -49,7 +49,7 @@ struct SmallNameDict{
return true;
}
)
PK_UNREACHABLE();
PK_UNREACHABLE()
}
V try_get(K key) const {

View File

@ -854,7 +854,7 @@ __NEXT_STEP:;
#undef DISPATCH_OP_CALL
#undef CEVAL_STEP
/**********************************************************************/
PK_UNREACHABLE();
PK_UNREACHABLE()
}catch(HandledException){
continue;
}catch(UnhandledException){

View File

@ -111,7 +111,7 @@ namespace pkpy{
return index;
}
}
PK_UNREACHABLE();
PK_UNREACHABLE()
}
int CodeEmitContext::add_func_decl(FuncDecl_ decl){
@ -626,7 +626,7 @@ namespace pkpy{
case TK("!="): ctx->emit_(OP_COMPARE_NE, BC_NOARG, line); break;
case TK(">"): ctx->emit_(OP_COMPARE_GT, BC_NOARG, line); break;
case TK(">="): ctx->emit_(OP_COMPARE_GE, BC_NOARG, line); break;
default: PK_UNREACHABLE();
default: PK_UNREACHABLE()
}
// [b, RES]
int index = ctx->emit_(OP_SHORTCUT_IF_FALSE_OR_POP, BC_NOARG, line);

View File

@ -466,7 +466,7 @@ i64 VM::py_hash(PyObject* obj){
}
if(has_custom_eq){
TypeError(fmt("unhashable type: ", ti->name.escape()));
PK_UNREACHABLE();
PK_UNREACHABLE()
}else{
return PK_BITS(obj);
}