]> granicus.if.org Git - python/commit
Fixed bpo-29565: Corrected ctypes passing of large structs by value on Windows AMD64...
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Mon, 20 Feb 2017 00:16:33 +0000 (00:16 +0000)
committerGitHub <noreply@github.com>
Mon, 20 Feb 2017 00:16:33 +0000 (00:16 +0000)
commita86339b83fbd0932e0529a3c91935e997a234582
tree34b0c69efbc4097a78b6292050460d8ba1df6265
parent3eea8c67fa870c6e2b7a521d292afe7fe3e95f58
Fixed bpo-29565: Corrected ctypes passing of large structs by value on Windows AMD64. (#168)

* Fixed bpo-29565: Corrected ctypes passing of large structs by value.

Added code and test to check that when a structure passed by value
is large enough to need to be passed by reference, a copy of the
original structure is passed. The callee updates the passed-in value,
and the test verifies that the caller's copy is unchanged. A similar
change was also added to the test added for bpo-20160 (that test was
passing, but the changes should guard against regressions).

* Reverted unintended whitespace changes.
Lib/ctypes/test/test_callbacks.py
Lib/ctypes/test/test_structures.py
Modules/_ctypes/_ctypes_test.c
Modules/_ctypes/libffi_msvc/ffi.c