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

Commit580f6cb

Browse files
author
Alexander Korotkov
committed
Fix some clang analyzer complaints.
1 parent0dc0ef4 commit580f6cb

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

‎jsonb_gin_ops.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,8 @@ gin_extract_jsonb_value_path_internal(Jsonb *jb, int32 *nentries, uint32 **bloom
691691
stack->parent=tmp;
692692
break;
693693
caseWJB_KEY:
694+
if (!stack)/* should never happen */
695+
elog(ERROR,"error jsonb iteration");
694696
stack->hash=0;
695697
JsonbHashScalarValue(&v,&stack->hash);
696698
break;
@@ -709,6 +711,8 @@ gin_extract_jsonb_value_path_internal(Jsonb *jb, int32 *nentries, uint32 **bloom
709711
break;
710712
caseWJB_END_OBJECT:
711713
/* Pop the stack */
714+
if (!stack)/* should never happen */
715+
elog(ERROR,"error jsonb iteration");
712716
tmp=stack->parent;
713717
pfree(stack);
714718
stack=tmp;
@@ -1109,6 +1113,9 @@ gin_extract_jsonb_path_value_internal(Jsonb *jb, int32 *nentries)
11091113
entries= (Datum*)repalloc(entries,sizeof(Datum)*total);
11101114
}
11111115

1116+
if (!stack)/* should never happen */
1117+
elog(ERROR,"error jsonb iteration");
1118+
11121119
switch (r)
11131120
{
11141121
caseWJB_BEGIN_ARRAY:
@@ -1131,6 +1138,8 @@ gin_extract_jsonb_path_value_internal(Jsonb *jb, int32 *nentries)
11311138
break;
11321139
caseWJB_KEY:
11331140
/* Initialize hash from parent */
1141+
if (!stack->parent)/* should never happen */
1142+
elog(ERROR,"error jsonb iteration");
11341143
stack->hash=stack->parent->hash;
11351144
JsonbHashScalarValue(&v,&stack->hash);
11361145
break;

‎jsquery_extract.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ recursiveExtract(JsQueryItem *jsq, bool not, bool indirect, PathItem *path)
4848
ExtractedNodeTypetype;
4949
JsQueryItemelem,e;
5050

51+
e.hint= false;
5152
check_stack_depth();
5253

5354
switch(jsq->type)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp