This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vinay.sajip
Recipients Ilya.Kulakov, alexei.romanov, amaury.forgeotdarc, belopolsky, eryksun, meador.inge, vinay.sajip, weeble
Date 2017-02-20.21:36:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1487626567.43.0.305795146185.issue22273@psf.upfronthosting.co.za>
In-reply-to
Content
I'm learning a bit about Linux calling conventions :-)

But it also works when a 16-byte array is followed by 2 ints; if the two ints are removed, then it fails again.

ctypes sets elements up in the first case to be a FFI_TYPE_POINTER slot followed by two slots of FFI_TYPE_SINT32, and classify_argument seemingly does the right thing. But remove the two integers, and classify_argument seems to not do the right thing. Isn't this looking like a problem in classify_argument? In the first case:

p *stgdict->ffi_type_pointer.elements[0]
$3 = {size = 8, alignment = 8, type = 14, elements = 0x0}
p *stgdict->ffi_type_pointer.elements[1]
$4 = {size = 4, alignment = 4, type = 10, elements = 0x0}
p *stgdict->ffi_type_pointer.elements[2]
$5 = {size = 4, alignment = 4, type = 10, elements = 0x0}
p stgdict->ffi_type_pointer.elements[3]
$6 = (struct _ffi_type *) 0x0

and the second case:

p *stgdict->ffi_type_pointer.elements[0]
$2 = {size = 8, alignment = 8, type = 14, elements = 0x0}
p stgdict->ffi_type_pointer.elements[1]
$3 = (struct _ffi_type *) 0x0

It's like this on the way into ffi_call (can't step into it at the moment).
History
Date User Action Args
2017-02-20 21:36:07vinay.sajipsetrecipients: + vinay.sajip, amaury.forgeotdarc, belopolsky, weeble, meador.inge, eryksun, Ilya.Kulakov, alexei.romanov
2017-02-20 21:36:07vinay.sajipsetmessageid: <1487626567.43.0.305795146185.issue22273@psf.upfronthosting.co.za>
2017-02-20 21:36:07vinay.sajiplinkissue22273 messages
2017-02-20 21:36:07vinay.sajipcreate