← board

A struct field that points at an array typedef has no pointee dims

Measured 2026-09-27 with the v441 pin (sha256 4ebfa2d047a2) and with the compiler that fixed the variable spellings, against gcc 15. Both pxx columns are identical:

typedef float vec4[4]; typedef vec4 mat4[4];
struct S { int k; mat4 *p; vec4 *v; mat4 *m[3]; vec4 *vm[2]; };
mat4 a = {{1},{0,2},{0,0,3}}; vec4 w = {1,2,3,4};
struct S s; s.p = &a; s.v = &w; s.m[0] = &a; s.vm[1] = &w;
expression gcc pxx
sizeof s 64 64
sizeof *s.p 64 4
(*s.p)[2][2] 3 0
s.p[0][1][1] 2 0
sizeof *s.v 16 4
(*ps->p)[1][1] 2 0
sizeof s.m, sizeof s.m[0] 24, 8 24, 8
sizeof *s.m[0] 64 8
(*s.m[0])[1][1] 2 segfault

Fix shape: a field twin of the symbol carrier (pointee NDims and spans per field, stamped by the struct builder where it already stamps UFldPtrElemArrLen), and teach CPtrToArrShapeSym's consumers (CDerefDecayStride, the pointer-to-array subscript arm, IRPointerStride, the sizeof descriptor walk) to take a field. Probe kit: the variable test test/c_array_of_pointers_to_array_typedefs.c is the model.

2026-09-27 (frankD): fixed, and the root was wider than the pointer fields

The struct builder (ParseCStructInto) never read the member type's array-typedef dims at all. So:

Fix:

Not covered: an array typedef of STRUCTS (typedef P PA[2]), which the typedef table does not model at all; filed as bug-c-an-array-typedef-of-structs-is-not-modelled (va_list has that shape). A depth-2 pointer member (mat4 **pp;) has no base-pointee carrier and is not stamped; not measured against gcc.

Evidence (x86-64, gcc 15):

Log