← board

sizeof of a pointer-to-array row reached by an expression

Measured 2026-09-25, x86-64, HEAD at c99f594735 plus the array-CL change. int iz[2][3]; int (*p)[3] = iz;

expression gcc pxx
sizeof(*p) 12 12
sizeof(p[0]) 12 4
sizeof(*(0, p)) 12 8
sizeof(*(int (*)[3])iz) 12 8

The subscripts and derefs themselves are correct: the values read through every one of these spellings match gcc. Only the size is wrong.

Fix direction: give sizeof a node-level answer. Walk the operand the way IRPointerStride / ResolveNodeRec do (strip the comma, the cast and the deref/index), and find the pointer symbol's SymPtrElemArrLen/NDims. Don't add a fifth per-spelling arm.