This commit is contained in:
blueloveTH 2024-06-02 18:17:20 +08:00
parent 097a7fe94f
commit 7738142985
4 changed files with 9 additions and 15 deletions

View File

@ -25,4 +25,10 @@ inline const char* kPlatformStrings[] = {
"unknown" // 6 "unknown" // 6
}; };
#ifdef _MSC_VER
#define PK_UNREACHABLE() __assume(0);
#else
#define PK_UNREACHABLE() __builtin_unreachable();
#endif
} // namespace pkpy } // namespace pkpy

View File

@ -68,15 +68,3 @@
#define PK_PLATFORM_SEP '/' #define PK_PLATFORM_SEP '/'
#endif #endif
#ifdef _MSC_VER
#pragma warning (disable:4267)
#pragma warning (disable:4100)
#pragma warning (disable:4244)
#pragma warning (disable:4996)
#endif
#ifdef _MSC_VER
#define PK_UNREACHABLE() __assume(0);
#else
#define PK_UNREACHABLE() __builtin_unreachable();
#endif

View File

@ -1043,11 +1043,11 @@ __NEXT_STEP:
*p = VAR(CAST(i64, *p) - 1); *p = VAR(CAST(i64, *p) - 1);
} DISPATCH() } DISPATCH()
/*****************************************/ /*****************************************/
default: PK_UNREACHABLE(); default: PK_UNREACHABLE()
} }
} }
/**********************************************************************/ /**********************************************************************/
PK_UNREACHABLE(); PK_UNREACHABLE()
}catch(InternalException internal){ }catch(InternalException internal){
__internal_exception = internal; __internal_exception = internal;
if(internal.type == InternalExceptionType::Unhandled){ if(internal.type == InternalExceptionType::Unhandled){

View File

@ -1101,7 +1101,7 @@ PyVar VM::vectorcall(int ARGC, int KWARGC, bool op_call){
callstack.popx(), callstack.popx(),
ArgsView(__vectorcall_buffer, __vectorcall_buffer + co->nlocals) ArgsView(__vectorcall_buffer, __vectorcall_buffer + co->nlocals)
); );
default: PK_UNREACHABLE(); default: PK_UNREACHABLE()
}; };
// simple or normal // simple or normal