mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
866abe2c63
commit
42a7d02286
@ -49,7 +49,7 @@ static cJSON* convert_python_object_to_cjson(PyObject* obj, VM* vm){
|
|||||||
return cJSON_CreateNull();
|
return cJSON_CreateNull();
|
||||||
}
|
}
|
||||||
vm->TypeError(fmt("unrecognized type ", obj_type_name(vm, obj_t).escape()));
|
vm->TypeError(fmt("unrecognized type ", obj_type_name(vm, obj_t).escape()));
|
||||||
PK_UNREACHABLE();
|
PK_UNREACHABLE()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,10 +66,10 @@
|
|||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define PK_ENABLE_COMPUTED_GOTO 0
|
#define PK_ENABLE_COMPUTED_GOTO 0
|
||||||
#define PK_UNREACHABLE() __assume(0)
|
#define PK_UNREACHABLE() __assume(0);
|
||||||
#else
|
#else
|
||||||
#define PK_ENABLE_COMPUTED_GOTO 1
|
#define PK_ENABLE_COMPUTED_GOTO 1
|
||||||
#define PK_UNREACHABLE() __builtin_unreachable()
|
#define PK_UNREACHABLE() __builtin_unreachable();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ struct SmallNameDict{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
PK_UNREACHABLE();
|
PK_UNREACHABLE()
|
||||||
}
|
}
|
||||||
|
|
||||||
V try_get(K key) const {
|
V try_get(K key) const {
|
||||||
|
@ -854,7 +854,7 @@ __NEXT_STEP:;
|
|||||||
#undef DISPATCH_OP_CALL
|
#undef DISPATCH_OP_CALL
|
||||||
#undef CEVAL_STEP
|
#undef CEVAL_STEP
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
PK_UNREACHABLE();
|
PK_UNREACHABLE()
|
||||||
}catch(HandledException){
|
}catch(HandledException){
|
||||||
continue;
|
continue;
|
||||||
}catch(UnhandledException){
|
}catch(UnhandledException){
|
||||||
|
@ -111,7 +111,7 @@ namespace pkpy{
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PK_UNREACHABLE();
|
PK_UNREACHABLE()
|
||||||
}
|
}
|
||||||
|
|
||||||
int CodeEmitContext::add_func_decl(FuncDecl_ decl){
|
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_NE, BC_NOARG, line); break;
|
||||||
case TK(">"): ctx->emit_(OP_COMPARE_GT, 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;
|
case TK(">="): ctx->emit_(OP_COMPARE_GE, BC_NOARG, line); break;
|
||||||
default: PK_UNREACHABLE();
|
default: PK_UNREACHABLE()
|
||||||
}
|
}
|
||||||
// [b, RES]
|
// [b, RES]
|
||||||
int index = ctx->emit_(OP_SHORTCUT_IF_FALSE_OR_POP, BC_NOARG, line);
|
int index = ctx->emit_(OP_SHORTCUT_IF_FALSE_OR_POP, BC_NOARG, line);
|
||||||
|
@ -466,7 +466,7 @@ i64 VM::py_hash(PyObject* obj){
|
|||||||
}
|
}
|
||||||
if(has_custom_eq){
|
if(has_custom_eq){
|
||||||
TypeError(fmt("unhashable type: ", ti->name.escape()));
|
TypeError(fmt("unhashable type: ", ti->name.escape()));
|
||||||
PK_UNREACHABLE();
|
PK_UNREACHABLE()
|
||||||
}else{
|
}else{
|
||||||
return PK_BITS(obj);
|
return PK_BITS(obj);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user