https://bugs.winehq.org/show_bug.cgi?id=49598
--- Comment #5 from Béla Gyebrószki gyebro69@gmail.com --- (In reply to Sagawa from comment #4)
Created attachment 67825 [details] Proposed patch
Could you try this patch?
Reading the code, I found another issue in the code. After fixing it, this issue doesn't happen, too.
The patch doesn't fix the problem for me, using GCC 10.1 on Arch Linux. Wine was compiled with -O2.
Sure enough, the bug doesn't appear with -O0.