On 2020-02-26 22:06, Peter Geoghegan wrote:
> Add deduplication to nbtree.

AddressSanitizer has a use-after-scope complaint related to this patch.

The following change fixes it:

diff --git a/src/backend/access/nbtree/nbtinsert.c 
b/src/backend/access/nbtree/nbtinsert.c
index a70b64d964..8246ab4f18 100644
--- a/src/backend/access/nbtree/nbtinsert.c
+++ b/src/backend/access/nbtree/nbtinsert.c
@@ -1289,6 +1289,7 @@ _bt_insertonpg(Relation rel,
                        xl_btree_metadata xlmeta;
                        uint8           xlinfo;
                        XLogRecPtr      recptr;
+                       uint16          upostingoff;
 
                        xlrec.offnum = newitemoff;
 
@@ -1354,7 +1355,7 @@ _bt_insertonpg(Relation rel,
                                 * must reconstruct final itup (as well as 
nposting) using
                                 * _bt_swap_posting().
                                 */
-                               uint16          upostingoff = postingoff;
+                               upostingoff = postingoff;
 
                                XLogRegisterBufData(0, (char *) &upostingoff, 
sizeof(uint16));
                                XLogRegisterBufData(0, (char *) origitup,

Please check.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Reply via email to