This code in bootstrap.c contains a sequence point violation (or
whatever that is really called):

        while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
        {
            (*app)->am_oid = HeapTupleGetOid(tup);
            memmove((char *) &(*app++)->am_typ,
                    (char *) GETSTRUCT(tup),
                    sizeof((*app)->am_typ));
        }

In commit 1aebc361, another place in the same file was fixed like this:

@@ -445,13 +455,13 @@ struct typmap
        while (HeapTupleIsValid(tup = heap_getnext(scan, 0)))
        {
            (*app)->am_oid = tup->t_data->t_oid;
-           memmove((char *) &(*app++)->am_typ,
-                   (char *) GETSTRUCT(tup),
-                   sizeof((*app)->am_typ));
+           memcpy((char *) &(*app)->am_typ,
+                  (char *) GETSTRUCT(tup),
+                  sizeof((*app)->am_typ));
+           app++;
        }
        heap_endscan(scan);
        heap_close(rel, NoLock);

I think the same (move the app++, and change to memcpy (optionally))
should be done in the first case as well.



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to