Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d50e256

Browse files
committed
Fix another place that was assuming that a local variable declared as
"struct varlena" would be at least word-aligned. Per buildfarm results from gypsy_moth. I did a little bit of trawling for other instances of this coding pattern, and didn't find any; but if we turn up any more of them I think we'd better revert the "char [4]" patch and find another way of making tuptoaster.c alignment-safe.
1 parent e04fa58 commit d50e256

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/backend/storage/large_object/inv_api.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
*
2626
* IDENTIFICATION
27-
* $PostgreSQL: pgsql/src/backend/storage/large_object/inv_api.c,v 1.127 2008/01/01 19:45:52 momjian Exp $
27+
* $PostgreSQL: pgsql/src/backend/storage/large_object/inv_api.c,v 1.128 2008/03/01 19:26:22 tgl Exp $
2828
*
2929
*-------------------------------------------------------------------------
3030
*/
@@ -516,7 +516,8 @@ inv_write(LargeObjectDesc *obj_desc, const char *buf, int nbytes)
516516
struct
517517
{
518518
bytea hdr;
519-
char data[LOBLKSIZE];
519+
char data[LOBLKSIZE]; /* make struct big enough */
520+
int32 align_it; /* ensure struct is aligned well enough */
520521
} workbuf;
521522
char *workb = VARDATA(&workbuf.hdr);
522523
HeapTuple newtup;
@@ -707,7 +708,8 @@ inv_truncate(LargeObjectDesc *obj_desc, int len)
707708
struct
708709
{
709710
bytea hdr;
710-
char data[LOBLKSIZE];
711+
char data[LOBLKSIZE]; /* make struct big enough */
712+
int32 align_it; /* ensure struct is aligned well enough */
711713
} workbuf;
712714
char *workb = VARDATA(&workbuf.hdr);
713715
HeapTuple newtup;

0 commit comments

Comments
 (0)