Skip to content

Conversation

@mrcsms
Copy link
Contributor

@mrcsms mrcsms commented Aug 19, 2021

It's a fix for a problem I found doing threading controlled outside p4d. With optimizations enabled, delphi treats PyGILState_STATE enum as 1-byte by default, but vc++ compiled python.dll has it as a 4-byte enum. Calls to PyGILState_Release with a 1-byte argument (decompiled to something like mov al, 0; call PyGILState_Release;) leads to unexpected behaviour because most significant bytes could have "random" values, depending on what happens to the AX register before calling.
For this fix, I have only internal tests for my system, but I think it can be important for someone else

@pyscripter pyscripter merged commit 6c4d6c7 into pyscripter:master Aug 19, 2021
@mrcsms mrcsms deleted the bugfix/PyGILState_Release_correction branch September 17, 2021 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants