This is an automated email from the ASF dual-hosted git repository.

avamingli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 120758cf1bdfbe3ad7af64e95d436d9e65b7fa0a
Author: Xing Guo <[email protected]>
AuthorDate: Mon Apr 1 19:27:08 2024 +0800

    Add missing volatile qualifier. (#17273)
    
    According to C99 7.13.2.1[^1],
    
    > All accessible objects have values, and all other components of the
    abstract machine have state, as of the time the longjmp function was
    called, except that the values of objects of automatic storage duration
    that are local to the function containing the invocation of the
    corresponding setjmp macro that do not have volatile-qualified type and
    have been changed between the setjmp invocation and longjmp call are
    indeterminate.
    
    The object `toplevelOidCache` is changed in line 657 (in the PG_TRY()
    block) and read in line 719 (in the PG_CATCH() block). We should qualify
    it with `volatile`.
    
    [^1]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
---
 src/backend/executor/execMain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 471c76bfb1..67e1274669 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -248,7 +248,7 @@ standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
        GpExecIdentity exec_identity;
        bool            shouldDispatch;
        bool            needDtx;
-       List            *toplevelOidCache = NIL;
+       List            *volatile toplevelOidCache = NIL;
 
        /* sanity checks: queryDesc must not be started already */
        Assert(queryDesc != NULL);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to