mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 14:00:16 +02:00
unittests: Test for the noexec pagefault trap number
This commit is contained in:
1 parent
dd5c17291a
commit
e383cc89eb
1 file changed
+4
@@ -10,8 +10,12 @@ bool Caught = false;
|
||||
static jmp_buf LongJump {};
|
||||
|
||||
static void SIGSEGV_Handler(int signal, siginfo_t* siginfo, void* context) {
|
||||
ucontext_t* _context = (ucontext_t*)context;
|
||||
// Needs to be an access error.
|
||||
REQUIRE(siginfo->si_code == SEGV_ACCERR);
|
||||
|
||||
// Page fault
|
||||
REQUIRE(_context->uc_mcontext.gregs[REG_TRAPNO] == 14);
|
||||
Caught = true;
|
||||
longjmp(LongJump, 1);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user