Hi Sunshine,
Oh the patch is working I'm sure and in any case I'm on WIN 23H2 which does not show the issue.
I was just trying the patch to see if it affected a 64 bit build that causes the aforementioned error.
Most 64 bit program compile nicely, but a few run into the Access violation error. In some cases rearranging the code can remove the access violation but it is hit and miss. The 32 bit build of the same code never has an issue.
John Z
Hi John,
According to my recent research, pocc has a special optimization for functions such as exit, _Exit, and abort. It uses the JMP instruction to replace the CALL instruction, but does not align the function stack frame. This problem affects the toolchain and runtime library. I patched several tools that did not work properly and patched all the places that seemed to have problems in the runtime library. Of course, only the 64-bit version needs to be patched. Especially, I patched pocc, let it emit some instructions to align the stack pointer before jump to functions like exit, _Exit and abort. So the user code can call these functions without an access violation. You may find my latest patched version on the GitHub.
https://github.com/fengyoulin/pellescAfter all, I don't have the source code. I can only make small patches based on these binaries. This may not completely solve the problem, or may introduce new problems. I'm doing all this just in the hope that the tool will be usable until Pelle releases his next version.
Good luck to Pelle. Good luck to us.