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

Commitbf9165b

Browse files
committed
Declare a couple of variables inside not outside a PG_TRY block.
I went through the buildfarm's reports of "warning: variable 'foo'might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]". As usual,none of them are live problems according to my understanding of theeffects of setjmp/longjmp, to wit that local variables might revertto their values as of PG_TRY entry, due to being kept in registers.But I did happen to notice that XmlTableGetValue's "cstr" variabledoesn't need to be declared outside the PG_TRY block at all (thusgiving further proof that the -Wclobbered warning has littleconnection to real problems). We might as well move it inside,and "cur" too, in hopes of eliminating one of the bogus warnings.
1 parent530f89e commitbf9165b

File tree

1 file changed

+5
-5
lines changed
  • src/backend/utils/adt

1 file changed

+5
-5
lines changed

‎src/backend/utils/adt/xml.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4926,10 +4926,8 @@ XmlTableGetValue(TableFuncScanState *state, int colnum,
49264926
Oidtypid,int32typmod,bool*isnull)
49274927
{
49284928
#ifdefUSE_LIBXML
4929-
XmlTableBuilderData*xtCxt;
49304929
Datumresult= (Datum)0;
4931-
xmlNodePtrcur;
4932-
char*cstr=NULL;
4930+
XmlTableBuilderData*xtCxt;
49334931
volatilexmlXPathObjectPtrxpathobj=NULL;
49344932

49354933
xtCxt=GetXmlTableBuilderPrivateData(state,"XmlTableGetValue");
@@ -4943,13 +4941,15 @@ XmlTableGetValue(TableFuncScanState *state, int colnum,
49434941

49444942
*isnull= false;
49454943

4946-
cur=xtCxt->xpathobj->nodesetval->nodeTab[xtCxt->row_count-1];
4947-
49484944
Assert(xtCxt->xpathscomp[colnum]!=NULL);
49494945

49504946
PG_TRY();
49514947
{
4948+
xmlNodePtrcur;
4949+
char*cstr=NULL;
4950+
49524951
/* Set current node as entry point for XPath evaluation */
4952+
cur=xtCxt->xpathobj->nodesetval->nodeTab[xtCxt->row_count-1];
49534953
xtCxt->xpathcxt->node=cur;
49544954

49554955
/* Evaluate column path */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp