From: Ralf Habacker <ralf.habacker@freenet.de> With the changes from this commit, the exception code is now correctly returned in the `EXCEPTION_RECORD` structure for previously unhandled cases in which the following messages were displayed: 00f4:fixme:seh:fpe_handler untested SIMD exception: 0x4. Might not work correctly 00f4:fixme:seh:fpe_handler untested SIMD exception: 0x5. Might not work correctly 00f4:fixme:seh:fpe_handler untested SIMD exception: 0x6. Might not work correctly Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56213 --- dlls/ntdll/unix/signal_i386.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 738e7169cad..fe018b53e51 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -2110,14 +2110,24 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *_sigcontext ) rec.ExceptionAddress = (void *)xcontext.c.FloatSave.ErrorOffset; break; case TRAP_x86_CACHEFLT: /* SIMD exception */ - /* TODO: - * Behaviour only tested for divide-by-zero exceptions - * Check for other SIMD exceptions as well */ - if(siginfo->si_code != FPE_FLTDIV && siginfo->si_code != FPE_FLTINV) - FIXME("untested SIMD exception: %#x. Might not work correctly\n", - siginfo->si_code); - - rec.ExceptionCode = STATUS_FLOAT_MULTIPLE_TRAPS; + switch (siginfo->si_code) + { + case FPE_FLTDIV: + case FPE_FLTINV: + rec.ExceptionCode = STATUS_FLOAT_MULTIPLE_TRAPS; + break; + + case FPE_FLTOVF: + case FPE_FLTUND: + case FPE_FLTRES: + rec.ExceptionCode = STATUS_FLOAT_MULTIPLE_FAULTS; + break; + + default: + FIXME("unknown SIMD exception: %#x\n", siginfo->si_code); + rec.ExceptionCode = STATUS_FLOAT_MULTIPLE_TRAPS; + break; + } rec.ExceptionInformation[rec.NumberParameters++] = 0; if (is_old_wow64()) rec.ExceptionInformation[rec.NumberParameters++] = ((XSAVE_FORMAT *)xcontext.c.ExtendedRegisters)->MxCsr; break; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11465