Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7292fd8

Browse files
committed
Suppress compiler warnings from commitee895a6.
For obscure reasons, some buildfarm members are now generatingcomplaints about plpgsql_call_handler's "retval" variable possiblybeing used uninitialized. It seems no less safe than it was beforethat commit, but these complaints are (mostly?) new. I trust thatinitializing the variable where it's declared will be enough toshut that up.I also notice that some compilers are warning about setjmp clobberof the same variable, which is maybe a bit more defensible. Markit volatile to silence that.Also, rearrange the logic to give procedure_resowner a singlepoint of initialization, in hopes of silencing some setjmp-clobberwarnings about that. (Marking it volatile would serve too, butits sibling variables are depending on single assignment, so let'sstick with that method.)Discussion:https://postgr.es/m/E1l4F1z-0000cN-Lx@gemulon.postgresql.org
1 parentf76a850 commit7292fd8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎src/pl/plpgsql/src/pl_handler.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ plpgsql_call_handler(PG_FUNCTION_ARGS)
224224
boolnonatomic;
225225
PLpgSQL_function*func;
226226
PLpgSQL_execstate*save_cur_estate;
227-
ResourceOwnerprocedure_resowner=NULL;
228-
Datumretval;
227+
ResourceOwnerprocedure_resowner;
228+
volatileDatumretval= (Datum)0;
229229
intrc;
230230

231231
nonatomic=fcinfo->context&&
@@ -254,9 +254,9 @@ plpgsql_call_handler(PG_FUNCTION_ARGS)
254254
* Therefore, be very wary of adding any code between here and the PG_TRY
255255
* block.
256256
*/
257-
if (nonatomic&&func->requires_procedure_resowner)
258-
procedure_resowner=
259-
ResourceOwnerCreate(NULL,"PL/pgSQL procedure resources");
257+
procedure_resowner=
258+
(nonatomic&&func->requires_procedure_resowner) ?
259+
ResourceOwnerCreate(NULL,"PL/pgSQL procedure resources") :NULL;
260260

261261
PG_TRY();
262262
{
@@ -271,7 +271,7 @@ plpgsql_call_handler(PG_FUNCTION_ARGS)
271271
{
272272
plpgsql_exec_event_trigger(func,
273273
(EventTriggerData*)fcinfo->context);
274-
retval= (Datum)0;
274+
/* there's no return value in this case */
275275
}
276276
else
277277
retval=plpgsql_exec_function(func,fcinfo,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp