mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-08 08:00:16 +02:00
ERROR_AND_DIE was using __builtin_trap which would send our application either a SIGILL or SIGTRAP depending on architecture. This would then be captured by our faulting system and passed over to the guest application. If the guest application happened to have a signal handler installed for these then it would pick up this fault and potentially continue unsafely. Now we can remove this usage of __builtin_trap and switch over to our own handler. Our frontend will check to see if the fault came from our handler and uninstall the host signal handlers in this case. Which is what we want for "ERROR_AND_DIE"
15 lines
231 B
C++
15 lines
231 B
C++
namespace FEXCore::Assert {
|
|
// This function can not be inlined
|
|
[[noreturn]]
|
|
__attribute__((noinline, naked))
|
|
void ForcedAssert() {
|
|
#ifdef _M_X86_64
|
|
asm volatile("ud2");
|
|
#else
|
|
asm volatile("hlt #1");
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|