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

Commitc7f5c58

Browse files
committed
PL/Python: Fix remaining scan-build warnings
Apparently, scan-build thinks that proc->is_setof can change duringPLy_exec_function(). To make it clearer, save the value in a localvariable.Also add an assertion to clear another warning.Reviewed-by: John Naylor <jcnaylor@gmail.com>
1 parentcdddd5d commitc7f5c58

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/pl/plpython/plpy_exec.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ static void PLy_abort_open_subtransactions(int save_subxact_level);
5757
Datum
5858
PLy_exec_function(FunctionCallInfofcinfo,PLyProcedure*proc)
5959
{
60+
boolis_setof=proc->is_setof;
6061
Datumrv;
6162
PyObject*volatileplargs=NULL;
6263
PyObject*volatileplrv=NULL;
@@ -73,7 +74,7 @@ PLy_exec_function(FunctionCallInfo fcinfo, PLyProcedure *proc)
7374

7475
PG_TRY();
7576
{
76-
if (proc->is_setof)
77+
if (is_setof)
7778
{
7879
/* First Call setup */
7980
if (SRF_IS_FIRSTCALL())
@@ -93,6 +94,7 @@ PLy_exec_function(FunctionCallInfo fcinfo, PLyProcedure *proc)
9394
funcctx=SRF_PERCALL_SETUP();
9495
Assert(funcctx!=NULL);
9596
srfstate= (PLySRFState*)funcctx->user_fctx;
97+
Assert(srfstate!=NULL);
9698
}
9799

98100
if (srfstate==NULL||srfstate->iter==NULL)
@@ -125,7 +127,7 @@ PLy_exec_function(FunctionCallInfo fcinfo, PLyProcedure *proc)
125127
* We stay in the SPI context while doing this, because PyIter_Next()
126128
* calls back into Python code which might contain SPI calls.
127129
*/
128-
if (proc->is_setof)
130+
if (is_setof)
129131
{
130132
if (srfstate->iter==NULL)
131133
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp