]> granicus.if.org Git - postgresql/commitdiff
Volatile-ize some plperl variables that must survive into PG_CATCH blocks.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 23 Jan 2017 14:15:49 +0000 (09:15 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 23 Jan 2017 14:15:49 +0000 (09:15 -0500)
This appears to be necessary to fix a failure seen on buildfarm member
sittella.  It shouldn't be necessary according to the letter of the C
standard, because we don't change the values of these variables within
the PG_TRY blocks; but somehow gcc 4.7.2 is dropping the ball.

Discussion: https://postgr.es/m/17555.1485179975@sss.pgh.pa.us

src/pl/plperl/plperl.c

index 9a2d0527f81bb0ed0166fb699cefd311fa842757..fc10d30f45be7aac863751f64d77c7a899a08148 100644 (file)
@@ -1763,8 +1763,8 @@ Datum
 plperl_call_handler(PG_FUNCTION_ARGS)
 {
        Datum           retval;
-       plperl_call_data *save_call_data = current_call_data;
-       plperl_interp_desc *oldinterp = plperl_active_interp;
+       plperl_call_data *volatile save_call_data = current_call_data;
+       plperl_interp_desc *volatile oldinterp = plperl_active_interp;
        plperl_call_data this_call_data;
 
        /* Initialize current-call status record */
@@ -1813,8 +1813,8 @@ plperl_inline_handler(PG_FUNCTION_ARGS)
        FunctionCallInfoData fake_fcinfo;
        FmgrInfo        flinfo;
        plperl_proc_desc desc;
-       plperl_call_data *save_call_data = current_call_data;
-       plperl_interp_desc *oldinterp = plperl_active_interp;
+       plperl_call_data *volatile save_call_data = current_call_data;
+       plperl_interp_desc *volatile oldinterp = plperl_active_interp;
        plperl_call_data this_call_data;
        ErrorContextCallback pl_error_context;