-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-34603: Fix returning structs from functions #9258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
cc @vstinner |
vstinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Oh, I'm sorry, I didn't notice that each additional tested size requires to write a long C code in _ctypes_test.c. IMHO it's not worth it and adds too much maintenance burden. I was concerned about a special case for size=16 bytes, but again, I don't think that it's worth it.
Would you mind to remove tests for 11..20, so only test 1..10? So we cover all special cases on 64-bit + size 9 and size 10 -- just in case.
|
@vladima: Would you mind to check if the issue exists upstream? https://github.com/libffi/libffi/tree/master/src |
|
@vstinner code upstream is a bit reshaped but at glance this issue is already fixed. |
…ythonGH-9258) (cherry picked from commit 7843cae) Co-authored-by: Vladimir Matveev <[email protected]>
|
GH-9340 is a backport of this pull request to the 3.7 branch. |
…ythonGH-9258) (cherry picked from commit 7843cae) Co-authored-by: Vladimir Matveev <[email protected]>
|
GH-9341 is a backport of this pull request to the 3.6 branch. |
|
GH-9342 is a backport of this pull request to the 2.7 branch. |
Cool, thanks for checking! |
…ythonGH-9258) (cherry picked from commit 7843cae) Co-authored-by: Vladimir Matveev <[email protected]>
…H-9258) (cherry picked from commit 7843cae) Co-authored-by: Vladimir Matveev <[email protected]>
…H-9258) (cherry picked from commit 7843cae) Co-authored-by: Vladimir Matveev <[email protected]>
…ions (pythonGH-9258) (cherry picked from commit 7843cae) Co-authored-by: Vladimir Matveev <[email protected]>
…ions (pythonGH-9258). (cherry picked from commit 7843cae) Co-authored-by: Vladimir Matveev <[email protected]>
…ions (GH-9258) (GH-9425) Co-authored-by: Vladimir Matveev <[email protected]>
python/cpython#9258 changed callproc to use functions from the internal libffi which we don't use. Just copy the functions into callproc directly instead.
python/cpython#9258 changed callproc to use functions from the internal libffi which we don't use. Just copy the functions into callproc directly instead.
python/cpython#9258 changed callproc to use functions from the internal libffi which we don't use. Just copy the functions into callproc directly instead.
Per MSDN: Return values:
Effectively if size of struct is not 1, 2, 4 or 8 bytes - caller needs to allocate a memory for the result and pass a pointer as a first argument.
https://bugs.python.org/issue34603