diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-04-06 11:28:47 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-04-06 11:28:47 +0200 |
| commit | 086daef49471bd5f8abecaf618bfdaee50ae729c (patch) | |
| tree | c47f19e8ef84c5ab786d171d52a63092b3e010ed /src/emu/x64runf20f.c | |
| parent | 6898df1c862cfdaaa6f3ed502aa7abb79e4accee (diff) | |
| download | box64-086daef49471bd5f8abecaf618bfdaee50ae729c.tar.gz box64-086daef49471bd5f8abecaf618bfdaee50ae729c.zip | |
Added back some isnan testing to integer conversion (converting a nan, infinite or overflow value to int is UB, and so should be avoided for max cross platform compatibility)
Diffstat (limited to 'src/emu/x64runf20f.c')
| -rw-r--r-- | src/emu/x64runf20f.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/emu/x64runf20f.c b/src/emu/x64runf20f.c index eb94958d..10da2f09 100644 --- a/src/emu/x64runf20f.c +++ b/src/emu/x64runf20f.c @@ -338,12 +338,12 @@ uintptr_t RunF20F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) tmp64s1 = EX->d[1]; break; } - if (tmp64s0==(int32_t)tmp64s0) { + if (tmp64s0==(int32_t)tmp64s0 && !isnan(EX->d[0])) { GX->sd[0] = (int32_t)tmp64s0; } else { GX->sd[0] = INT32_MIN; } - if (tmp64s1==(int32_t)tmp64s1) { + if (tmp64s1==(int32_t)tmp64s1 && !isnan(EX->d[1])) { GX->sd[1] = (int32_t)tmp64s1; } else { GX->sd[1] = INT32_MIN; |