[pypy-issue] [issue780] test_ll2ctypes.py -k test_arrayofstruct Error!

Amaury Forgeot d'Arc amauryfa at gmail.com
Tue Jul 12 10:33:56 CEST 2011


2011/7/12 Fijal <tracker at bugs.pypy.org>

> This kind of looks like a ctypes bug to me although it's not completely
> impossible to rule out some ll2ctypes problem.

This is both a ll2ctype issue and a ctypes bug.
- a ll2ctype issue, because it builds an array of an incomplete Structure
(i.e. _fields_ is not yet set); it's the expression "MAX_SIZE * ctypes_item"
- a ctypes bug, because it should not allow this: the * operation should
mark ctypes_item as "final"
and disallow the future change to _fields_.

This script reproduces it:

The fix is to delay the construction of the array.
I have a change in my workspace, will try to commit it tonight.

Amaury Forgeot d'Arc

More information about the pypy-issue mailing list