]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix misuse of "volatile" in xml.c
authorMichael Paquier <michael@paquier.xyz>
Mon, 9 Mar 2026 22:05:32 +0000 (07:05 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 9 Mar 2026 22:05:32 +0000 (07:05 +0900)
commit6307b096e2599edfe238816118b3f365a73fd12a
tree9339b411c25fb721c6c3efdee38d7716edea6630
parent7c8280eeb5872f5c2663b562a9c6fcf8ec8a4b82
Fix misuse of "volatile" in xml.c

What should be used is not "volatile foo *ptr" but "foo *volatile ptr",
The incorrect (former) style means that what the pointer variable points
to is volatile.  The correct (latter) style means that the pointer
variable itself needs to be treated as volatile.  The latter style is
required to ensure a consistent treatment of these variables after a
longjmp with the TRY/CATCH blocks.

Some casts can be removed thanks to this change.

Issue introduced by 2e947217474c, so no backpatch is required.  A
similar set of issues has been fixed in 93001888d85c for contrib/xml2/.

Author: ChangAo Chen <cca5507@qq.com>
Discussion: https://postgr.es/m/tencent_5BE8DAD985EE140ED62EA728C8D4E1311F0A@qq.com
src/backend/utils/adt/xml.c