From d24cbaf556816e6569b9fe47f6dc3446465db3f4 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 2 May 2023 09:11:43 +0000 Subject: [RV64_DYNAREC] Improved a bit the rv64 extension detection code --- src/rv64detect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rv64detect.c b/src/rv64detect.c index 5e84423b..9976d1d7 100644 --- a/src/rv64detect.c +++ b/src/rv64detect.c @@ -22,15 +22,15 @@ static int Check(void* block) // Clear instruction cache __clear_cache(block, block+box64_pagesize); // Setup SIGILL signal handler - signal(SIGILL, detect_sigill); + __sighandler_t old = signal(SIGILL, detect_sigill); if(sigsetjmp(sigbuf, 1)) { // didn't work, extension not present - signal(SIGILL, SIG_DFL); + signal(SIGILL, old); return 0; } ((vFii_t)block)(0, 1); // done... - signal(SIGILL, SIG_DFL); + signal(SIGILL, old); return 1; } -- cgit 1.4.1