Add missing volatile qualifier.

Variables being modified in the PG_TRY block and read in the PG_CATCH
block should be qualified with volatile.

The variable waitEventSet is modified in the PG_TRY block (line 1085)
and read in the PG_CATCH block (line 1095).

The variable relation is modified in the PG_TRY block (line 500) and
read in the PG_CATCH block (line 515).

Co-authored-by: Hong Yi <zouzou0208@gmail.com>
pull/7570/head
Xing Guo 2024-04-02 21:38:36 +08:00
parent 3929a5b2a6
commit 6a8f26cae6
2 changed files with 3 additions and 3 deletions

View File

@ -883,7 +883,7 @@ WaitForAllConnections(List *connectionList, bool raiseInterrupts)
palloc(totalConnectionCount * sizeof(MultiConnection *));
WaitEvent *events = palloc(totalConnectionCount * sizeof(WaitEvent));
bool *connectionReady = palloc(totalConnectionCount * sizeof(bool));
WaitEventSet *waitEventSet = NULL;
WaitEventSet *volatile waitEventSet = NULL;
/* convert connection list to an array such that we can move items around */
MultiConnection *connectionItem = NULL;

View File

@ -465,8 +465,8 @@ static bool
AnyObjectViolatesOwnership(DropStmt *dropStmt)
{
bool hasOwnershipViolation = false;
volatile ObjectAddress objectAddress = { 0 };
Relation relation = NULL;
ObjectAddress objectAddress = { 0 };
volatile Relation relation = NULL;
ObjectType objectType = dropStmt->removeType;
bool missingOk = dropStmt->missing_ok;