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

Appearance settings

Commit dc8a92f

Browse filesBrowse files
committed
Fix bug in v13 support. For now it's only observed with clang v11+ with -O0
level
1 parent 241b198 commit dc8a92f
Copy full SHA for dc8a92f

File tree

1 file changed

+23
-10
lines changed
Filter options

1 file changed

+23
-10
lines changed

‎src/rum_ts_utils.c

Copy file name to clipboardExpand all lines: src/rum_ts_utils.c
+23-10Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,16 @@ compareDocR(const void *va, const void *vb)
14321432
return (a->pos > b->pos) ? 1 : -1;
14331433
}
14341434

1435-
static bool
1435+
/*
1436+
* Be carefull: clang 11+ is very sensitive to casting function
1437+
* with different return value.
1438+
*/
1439+
static
1440+
#if PG_VERSION_NUM >= 130000
1441+
TSTernaryValue
1442+
#else
1443+
bool
1444+
#endif
14361445
checkcondition_QueryOperand(void *checkval, QueryOperand *val,
14371446
ExecPhraseData *data)
14381447
{
@@ -1453,7 +1462,11 @@ checkcondition_QueryOperand(void *checkval, QueryOperand *val,
14531462
data->allocated = false;
14541463
}
14551464

1456-
return qro->operandexist;
1465+
return qro->operandexist
1466+
#if PG_VERSION_NUM >= 130000
1467+
? TS_YES : TS_NO
1468+
#endif
1469+
;
14571470
}
14581471

14591472
static bool
@@ -1498,13 +1511,13 @@ Cover(DocRepresentation *doc, uint32 len, QueryRepresentation *qr,
14981511
}
14991512
}
15001513

1514+
if (TS_execute(GETQUERY(qr->query), (void *) qr,
15011515
#if PG_VERSION_NUM >= 130000
1502-
if (TS_execute(GETQUERY(qr->query), (void *) qr, TS_EXEC_SKIP_NOT,
1503-
(TSExecuteCallback) checkcondition_QueryOperand))
1516+
TS_EXEC_SKIP_NOT,
15041517
#else
1505-
if (TS_execute(GETQUERY(qr->query), (void *) qr, TS_EXEC_EMPTY,
1506-
checkcondition_QueryOperand))
1518+
TS_EXEC_EMPTY,
15071519
#endif
1520+
checkcondition_QueryOperand))
15081521
{
15091522
if (ptr->pos > ext->q)
15101523
{
@@ -1544,13 +1557,13 @@ Cover(DocRepresentation *doc, uint32 len, QueryRepresentation *qr,
15441557
WEP_SETWEIGHT(qro->pos, ptr->wclass);
15451558
}
15461559
}
1560+
if (TS_execute(GETQUERY(qr->query), (void *) qr,
15471561
#if PG_VERSION_NUM >= 130000
1548-
if (TS_execute(GETQUERY(qr->query), (void *) qr, TS_EXEC_EMPTY,
1549-
(TSExecuteCallback) checkcondition_QueryOperand))
1562+
TS_EXEC_EMPTY,
15501563
#else
1551-
if (TS_execute(GETQUERY(qr->query), (void *) qr, TS_EXEC_CALC_NOT,
1552-
checkcondition_QueryOperand))
1564+
TS_EXEC_CALC_NOT,
15531565
#endif
1566+
checkcondition_QueryOperand))
15541567
{
15551568
if (ptr->pos < ext->p)
15561569
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.