Am 05.01.2025 um 12:39 schrieb Andreas Grabher <andreas_g86@xxxxxxxxxx>:
Am 04.01.2025 um 18:07 schrieb Andreas Grabher <andreas_g86@xxxxxxxxxx>:
Am 31.12.2024 um 18:24 schrieb Andreas Grabher <andreas_g86@xxxxxxxxxx>:
Hello Toni,
here is a little patch that should fix some undefined behaviour (getting these from runtime checking). Please review before applying the patch.
There are many more warnings from cpuemu_XX files. But I don’t know how to fix those.
Kind regards,
Andreas
<cpu_warnings.txt>
I found some more. An updated patch is appended.
<cpu_warnings2.txt>
Another patch is appended. Now I also fixed the problems in the cpuemu_XX files. Please note that I only use cpuemu_31 and cpuemu32, so others are untested. It seems that all is working normally. But anyway I think some heavy review is needed, especially for the changes in gencpu.
I really think these issues need to be fixed, because with the current code undefined behaviour can occur in many critical functions.
Good news for Hatari: Although I tested only with Previous, no undefined behaviour was not detected in any file that was derived from Hatari, including all DSP code.
<cpu_warnings3.txt>
I’ve run into problems with my last patch. So here is a new one. There is quite some type chaos inside the CPU code. I get lots of undefined signed integer overflow, shifting with values greater than type size, shifting negative values, shifting with negative shifts, etc. Not sure this fixes all of them, but at least I no longer run into one of these immediately.