Skip to content

Commit e9c53b5

Browse files
committed
Fixes per clang analyzer complains
1 parent 78ec4f3 commit e9c53b5

File tree

7 files changed

+7
-8
lines changed

7 files changed

+7
-8
lines changed

src/rum_arr_utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ cmpAscArrayElem(const void *a, const void *b, void *arg)
733733
{
734734
FmgrInfo *cmpFunc = (FmgrInfo*)arg;
735735

736+
Assert(a && b);
736737
return DatumGetInt32(FunctionCall2Coll(cmpFunc, DEFAULT_COLLATION_OID, *(Datum*)a, *(Datum*)b));
737738
}
738739

src/rum_ts_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ calc_score_docr(float4 *arrdata, DocRepresentation *doc, uint32 doclen,
12421242
int new_cover_key = 0;
12431243
int nitems = 0;
12441244

1245-
while (ptr <= ext.end)
1245+
while (ptr && ptr <= ext.end)
12461246
{
12471247
InvSum += arrdata[ptr->wclass];
12481248
/* SK: Quick and dirty hash key. Hope collisions will be not too frequent. */

src/rumget.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ entryGetNextItemList(RumState * rumstate, RumScanEntry entry, Snapshot snapshot)
11121112
entry->isFinished = setListPositionScanEntry(rumstate, entry);
11131113
}
11141114

1115-
Assert(entry->nlist > 0);
1115+
Assert(entry->nlist > 0 && entry->list);
11161116

11171117
entry->curItem = entry->list[entry->offset];
11181118
entry->offset += entry->scanDirection;
@@ -1169,7 +1169,7 @@ entryGetItem(RumState * rumstate, RumScanEntry entry, bool *nextEntryList, Snaps
11691169
if (!ItemPointerIsMin(&entry->collectRumItem.item.iptr))
11701170
collected = entry->collectRumItem;
11711171
else
1172-
ItemPointerSetMin(&collected.item.iptr);
1172+
MemSet(&collected, 0, sizeof(collected));
11731173

11741174
ItemPointerSetMin(&entry->curItem.iptr);
11751175

src/rumsort.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2426,7 +2426,6 @@ mergeruns(RumTuplesortstate *state)
24262426
else
24272427
{
24282428
numInputTapes = state->tapeRange;
2429-
numTapes = state->maxTapes;
24302429
}
24312430

24322431
state->read_buffer_size = Max(state->availMem / numInputTapes, 0);

src/rumvacuum.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ rumVacuumPostingList(RumVacuumState * gvs, OffsetNumber attnum, Pointer src,
5353
prev,
5454
ptr = src;
5555

56+
*newSize = 0;
5657
ItemPointerSetMin(&item.iptr);
5758

5859
/*

travis/mk_dockerfile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if [ -z ${PG_VERSION+x} ]; then
44
fi
55

66
if [ -z ${LEVEL+x} ]; then
7-
LEVEL=scan-build
7+
LEVEL=standard
88
fi
99

1010
echo PG_VERSION=${PG_VERSION}

travis/run_tests.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#
66
# supported levels:
77
# * standard
8-
# * scan-build
98
# * hardcore
109
#
1110

@@ -60,8 +59,7 @@ fi
6059
pg_config
6160

6261
# perform code checks if asked to
63-
if [ "$LEVEL" = "scan-build" ] || \
64-
[ "$LEVEL" = "hardcore" ]; then
62+
if [ "$LEVEL" = "hardcore" ]; then
6563

6664
# perform static analyzis
6765
scan-build --status-bugs make USE_PGXS=1 || status=$?

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy