Skip to content

Commit 5971718

Browse files
author
Artur Zakirov
committed
Initialize pos1 and pos2 in rum_ts_join_pos()
1 parent 86bc9c9 commit 5971718

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

rum_ts_utils.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ PG_FUNCTION_INFO_V1(rum_ts_join_pos);
4040
PG_FUNCTION_INFO_V1(tsquery_to_distance_query);
4141

4242
static int count_pos(char *ptr, int len);
43-
static char *decompress_pos(char *ptr, uint16 *pos);
43+
static char *decompress_pos(char *ptr, WordEntryPos *pos);
4444

4545
typedef struct
4646
{
@@ -317,7 +317,7 @@ rum_tsquery_timestamp_consistent(PG_FUNCTION_ARGS)
317317
#define LOWERMASK 0x1F
318318

319319
static int
320-
compress_pos(char *target, uint16 *pos, int npos)
320+
compress_pos(char *target, WordEntryPos *pos, int npos)
321321
{
322322
int i;
323323
uint16 prev = 0,
@@ -350,7 +350,7 @@ compress_pos(char *target, uint16 *pos, int npos)
350350
}
351351

352352
static char *
353-
decompress_pos(char *ptr, uint16 *pos)
353+
decompress_pos(char *ptr, WordEntryPos *pos)
354354
{
355355
int i;
356356
uint8 v;
@@ -1328,14 +1328,15 @@ rum_ts_join_pos(PG_FUNCTION_ARGS)
13281328
count2 = count_pos(in2, VARSIZE_ANY_EXHDR(addInfo2)),
13291329
countRes = 0,
13301330
i1 = 0, i2 = 0, size;
1331-
WordEntryPos pos1, pos2, *pos;
1331+
WordEntryPos pos1 = 0,
1332+
pos2 = 0,
1333+
*pos;
13321334

13331335
result = palloc(VARHDRSZ + sizeof(WordEntryPos) * (count1 + count2));
13341336
pos = palloc(sizeof(WordEntryPos) * (count1 + count2));
13351337

13361338
Assert(count1 > 0 && count2 > 0);
13371339

1338-
13391340
in1 = decompress_pos(in1, &pos1);
13401341
in2 = decompress_pos(in2, &pos2);
13411342

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