Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bf9165b

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 the effects of setjmp/longjmp, to wit that local variables might revert to their values as of PG_TRY entry, due to being kept in registers. But I did happen to notice that XmlTableGetValue's "cstr" variable doesn't need to be declared outside the PG_TRY block at all (thus giving further proof that the -Wclobbered warning has little connection to real problems). We might as well move it inside, and "cur" too, in hopes of eliminating one of the bogus warnings.
1 parent 530f89e commit bf9165b

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
Oid typid, int32 typmod, bool *isnull)
49274927
{
49284928
#ifdef USE_LIBXML
4929-
XmlTableBuilderData *xtCxt;
49304929
Datum result = (Datum) 0;
4931-
xmlNodePtr cur;
4932-
char *cstr = NULL;
4930+
XmlTableBuilderData *xtCxt;
49334931
volatile xmlXPathObjectPtr xpathobj = 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+
xmlNodePtr cur;
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)