Fix a strict aliasing violation
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 1 Dec 2025 15:34:19 +0000 (16:34 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 1 Dec 2025 15:41:08 +0000 (16:41 +0100)
commit2fcc5a715130fbe9fb6eadf338e3bfe560eb0cb5
treef01d1587bf020594219d1d0fc70ccf9ee2ef84b9
parenta87987cafca683e9076c424f99bae117211a83a4
Fix a strict aliasing violation

This one is almost a textbook example of an aliasing violation, and it
is straightforward to fix, so clean it up.  (The warning only shows up
if you remove the -fno-strict-aliasing option.)  Also, move the code
after the error checking.  Doesn't make a difference technically, but
it seems strange to do actions before errors are checked.

Reported-by: Tatsuo Ishii <ishii@postgresql.org>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/20240724.155525.366150353176322967.ishii%40postgresql.org
src/backend/replication/logical/origin.c