generated abi-mode struct defs breaks unions
Created originally on Bitbucket by lunixbochs (Ryan Hileman)
If I run this union through ffi.emit_python_code
, the size becomes 32 instead of 16:
struct NVGcolor {
union {
float rgba[4];
struct { float r,g,b,a; };
};
};
But the size is right before emitting (all sizes in this output should be 16):
raw ffi: 16 16
generated ffi: 32 16
In the generated ffi code, the union size is 32, suggesting the union fields were combined into a larger incorrect struct. PoC attached, repros in pypy3 and cpython with cffi 1.11.4