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

Commit532a4c3

Browse files
committed
Be a little more careful with the shift computations in QT2QTN and
makeTSQuerySign. The first of these is a live bug, on some platforms,as per bug #5590 from John Regehr. However the consequences seem limitedbecause of the relatively narrow scope of use of QTNode.sign. The shift inmakeTSQuerySign is actually safe because TSQS_SIGLEN is unsigned, but itseems like a good idea to insert an explicit cast rather than depend on that.
1 parent57641a1 commit532a4c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎src/backend/utils/adt/tsquery_op.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_op.c,v 1.9 2010/08/0300:10:39 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_op.c,v 1.10 2010/08/0301:50:26 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -209,7 +209,7 @@ makeTSQuerySign(TSQuery a)
209209
for (i=0;i<a->size;i++)
210210
{
211211
if (ptr->type==QI_VAL)
212-
sign |= ((TSQuerySign)1) << (ptr->qoperand.valcrc %TSQS_SIGLEN);
212+
sign |= ((TSQuerySign)1) << (((unsignedint)ptr->qoperand.valcrc) %TSQS_SIGLEN);
213213
ptr++;
214214
}
215215

‎src/backend/utils/adt/tsquery_util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.14 2010/08/0300:10:39 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.15 2010/08/0301:50:27 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -45,7 +45,7 @@ QT2QTN(QueryItem *in, char *operand)
4545
elseif (operand)
4646
{
4747
node->word=operand+in->qoperand.distance;
48-
node->sign=1 << (in->qoperand.valcrc %32);
48+
node->sign=((uint32)1) << (((unsignedint)in->qoperand.valcrc) %32);
4949
}
5050

5151
returnnode;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp