pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr

2019-06-30 Thread Noah Misch
Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType. UBSan complains about this. Instead, cast to a suitable type requiring only 4-byte alignment. DatumGetAnyArrayP() already assumes one can cast between AnyArrayType and ArrayType, so this doesn't introduce a new assumption.

pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr

2019-06-30 Thread Noah Misch
Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType. UBSan complains about this. Instead, cast to a suitable type requiring only 4-byte alignment. DatumGetAnyArrayP() already assumes one can cast between AnyArrayType and ArrayType, so this doesn't introduce a new assumption.

pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr

2019-06-30 Thread Noah Misch
Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType. UBSan complains about this. Instead, cast to a suitable type requiring only 4-byte alignment. DatumGetAnyArrayP() already assumes one can cast between AnyArrayType and ArrayType, so this doesn't introduce a new assumption.

pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr

2019-06-30 Thread Noah Misch
Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType. UBSan complains about this. Instead, cast to a suitable type requiring only 4-byte alignment. DatumGetAnyArrayP() already assumes one can cast between AnyArrayType and ArrayType, so this doesn't introduce a new assumption.

pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr

2019-06-30 Thread Noah Misch
Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType. UBSan complains about this. Instead, cast to a suitable type requiring only 4-byte alignment. DatumGetAnyArrayP() already assumes one can cast between AnyArrayType and ArrayType, so this doesn't introduce a new assumption.