diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-06-21 10:05:06 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-06-21 10:05:06 +0200 |
| commit | 501ab2bbe8510b28496a25361028e8f5e202666f (patch) | |
| tree | 910287a0ff20773bc2d05cae562195208e9bbb0a /src/libtools | |
| parent | f78c5a2b1819724425cf8b000906963dc0464658 (diff) | |
| download | box64-501ab2bbe8510b28496a25361028e8f5e202666f.tar.gz box64-501ab2bbe8510b28496a25361028e8f5e202666f.zip | |
Rollback the signal/return address change limit
Diffstat (limited to 'src/libtools')
| -rwxr-xr-x | src/libtools/signals.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/libtools/signals.c b/src/libtools/signals.c index 7563b855..92f973b4 100755 --- a/src/libtools/signals.c +++ b/src/libtools/signals.c @@ -265,7 +265,7 @@ static void sigstack_key_alloc() { pthread_key_create(&sigstack_key, sigstack_destroy); } -uint64_t RunFunctionHandler(int* exit, int* lj, x64_ucontext_t* sigcontext, uintptr_t fnc, int nargs, ...) +uint64_t RunFunctionHandler(int* exit, x64_ucontext_t* sigcontext, uintptr_t fnc, int nargs, ...) { if(fnc==0 || fnc==1) { printf_log(LOG_NONE, "BOX64: Warning, calling Signal function handler %s\n", fnc?"SIG_IGN":"SIG_DFL"); @@ -319,8 +319,6 @@ uint64_t RunFunctionHandler(int* exit, int* lj, x64_ucontext_t* sigcontext, uint emu->quitonlongjmp = oldquitonlongjmp; if(emu->longjmp) { - if(lj) - *lj = 1; // longjmp inside signal handler, lets grab all relevent value and do the actual longjmp in the signal handler emu->longjmp = 0; if(sigcontext) { @@ -634,12 +632,11 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void R_RBP = sigcontext->uc_mcontext.gregs[X64_RBP]; int exits = 0; - int lj = box64_wine?0:1; int ret; if (simple) - ret = RunFunctionHandler(&exits, &lj, sigcontext, my_context->signals[sig], 1, sig); + ret = RunFunctionHandler(&exits, sigcontext, my_context->signals[sig], 1, sig); else - ret = RunFunctionHandler(&exits, &lj, sigcontext, my_context->signals[sig], 3, sig, info, sigcontext); + ret = RunFunctionHandler(&exits, sigcontext, my_context->signals[sig], 3, sig, info, sigcontext); // restore old value from emu #define GO(A) R_##A = old_##A GO(RAX); @@ -652,7 +649,7 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void GO(RBP); #undef GO - if(lj && memcmp(sigcontext, &sigcontext_copy, sizeof(x64_ucontext_t))) { + if(memcmp(sigcontext, &sigcontext_copy, sizeof(x64_ucontext_t))) { emu_jmpbuf_t* ejb = GetJmpBuf(); if(ejb->jmpbuf_ok) { #define GO(R) ejb->emu->regs[_##R].q[0]=sigcontext->uc_mcontext.gregs[X64_R##R] @@ -738,7 +735,7 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void exit(ret); } if(restorer) - RunFunctionHandler(&exits, NULL, NULL, restorer, 0); + RunFunctionHandler(&exits, NULL, restorer, 0); if(used_stack) // release stack new_ss->ss_flags = 0; relockMutex(Locks); |