Em qui., 11 de set. de 2025 às 12:36, Tom Lane <tgl@sss.pgh.pa.us> escreveu:
Ranier Vilela <ranier.vf@gmail.com> writes: > Em qua., 10 de set. de 2025 às 17:35, Tom Lane <tgl@sss.pgh.pa.us> escreveu: >> This is silently assuming that sizeof(SortItem) is a multiple of >> alignof(Datum), which on a 32-bit-pointer platform is not true >> any longer. We ought to MAXALIGN the two occurrences of >> data->numrows * sizeof(SortItem).
Neither of those have any hazard, because they are not trying to allocate multiple arrays using address arithmetic. The part of build_sorted_items that was actually problematic was doing
ptr += data->numrows * sizeof(SortItem);
and then assuming that the result was suitably aligned to be cast to Datum*.