mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
Previously, we encoded both NULL and the first byte at the base address as 0. That confusion led to the assertion in commite07d4ddc, which failed when min_dynamic_shared_memory was used. Give them distinct encodings, by switching to 1-based offsets for non-NULL pointers. Also improve macro hygiene in passing (missing/misplaced parentheses), and remove open-coded access to the raw offset value from freepage.c/h. Althoughe07d4ddcwas back-patched to 10, the only code that actually makes use of relptr at the base address arrived in84b1c63a, so no need to back-patch further than 14 for now. Reported-by: Justin Pryzby <pryzby@telsasoft.com> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Discussion: https://postgr.es/m/20220519193839.GT19626%40telsasoft.com
2.9 KiB
2.9 KiB