mirror of
https://github.com/postgres/postgres.git
synced 2026-07-15 20:52:53 -04:00
Fix some compiler warnings
Some of the buildfarm members with some old gcc versions have been complaining about an always-true test for a NULL pointer caused by a combination of SOFT_ERROR_OCCURRED() and a local ErrorSaveContext variable. These warnings are taken care of by removing SOFT_ERROR_OCCURRED(), switching to a direct variable check, like56b1e88c80. Oversights ine1405aa5e3and44eba8f06e. Reported-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/1341064.1764895052@sss.pgh.pa.us
This commit is contained in:
parent
83f2f8413e
commit
7bc88c3d6f
2 changed files with 5 additions and 5 deletions
|
|
@ -494,7 +494,7 @@ dependencies_scalar(void *state, char *token, JsonTokenType tokentype)
|
||||||
case DEPS_EXPECT_ATTNUM:
|
case DEPS_EXPECT_ATTNUM:
|
||||||
attnum = pg_strtoint16_safe(token, (Node *) &escontext);
|
attnum = pg_strtoint16_safe(token, (Node *) &escontext);
|
||||||
|
|
||||||
if (SOFT_ERROR_OCCURRED(&escontext))
|
if (escontext.error_occurred)
|
||||||
{
|
{
|
||||||
errsave(parse->escontext,
|
errsave(parse->escontext,
|
||||||
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||||
|
|
@ -539,7 +539,7 @@ dependencies_scalar(void *state, char *token, JsonTokenType tokentype)
|
||||||
parse->dependency = (AttrNumber)
|
parse->dependency = (AttrNumber)
|
||||||
pg_strtoint16_safe(token, (Node *) &escontext);
|
pg_strtoint16_safe(token, (Node *) &escontext);
|
||||||
|
|
||||||
if (SOFT_ERROR_OCCURRED(&escontext))
|
if (escontext.error_occurred)
|
||||||
{
|
{
|
||||||
errsave(parse->escontext,
|
errsave(parse->escontext,
|
||||||
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||||
|
|
@ -569,7 +569,7 @@ dependencies_scalar(void *state, char *token, JsonTokenType tokentype)
|
||||||
parse->degree = float8in_internal(token, NULL, "double",
|
parse->degree = float8in_internal(token, NULL, "double",
|
||||||
token, (Node *) &escontext);
|
token, (Node *) &escontext);
|
||||||
|
|
||||||
if (SOFT_ERROR_OCCURRED(&escontext))
|
if (escontext.error_occurred)
|
||||||
{
|
{
|
||||||
errsave(parse->escontext,
|
errsave(parse->escontext,
|
||||||
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||||
|
|
|
||||||
|
|
@ -435,7 +435,7 @@ ndistinct_scalar(void *state, char *token, JsonTokenType tokentype)
|
||||||
case NDIST_EXPECT_ATTNUM:
|
case NDIST_EXPECT_ATTNUM:
|
||||||
attnum = pg_strtoint16_safe(token, (Node *) &escontext);
|
attnum = pg_strtoint16_safe(token, (Node *) &escontext);
|
||||||
|
|
||||||
if (SOFT_ERROR_OCCURRED(&escontext))
|
if (escontext.error_occurred)
|
||||||
{
|
{
|
||||||
errsave(parse->escontext,
|
errsave(parse->escontext,
|
||||||
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||||
|
|
@ -485,7 +485,7 @@ ndistinct_scalar(void *state, char *token, JsonTokenType tokentype)
|
||||||
*/
|
*/
|
||||||
parse->ndistinct = pg_strtoint32_safe(token, (Node *) &escontext);
|
parse->ndistinct = pg_strtoint32_safe(token, (Node *) &escontext);
|
||||||
|
|
||||||
if (!SOFT_ERROR_OCCURRED(&escontext))
|
if (!escontext.error_occurred)
|
||||||
{
|
{
|
||||||
parse->state = NDIST_EXPECT_KEY;
|
parse->state = NDIST_EXPECT_KEY;
|
||||||
return JSON_SUCCESS;
|
return JSON_SUCCESS;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue