makeTSQuerySign. The first of these is a live bug, on some platforms,
as per bug #5590 from John Regehr. However the consequences seem limited
because of the relatively narrow scope of use of QTNode.sign. The shift in
makeTSQuerySign is actually safe because TSQS_SIGLEN is unsigned, but it
seems like a good idea to insert an explicit cast rather than depend on that.
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_op.c,v 1.9 2010/08/03 00:10:39 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_op.c,v 1.10 2010/08/03 01:50:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
for (i = 0; i < a->size; i++)
{
if (ptr->type == QI_VAL)
- sign |= ((TSQuerySign) 1) << (ptr->qoperand.valcrc % TSQS_SIGLEN);
+ sign |= ((TSQuerySign) 1) << (((unsigned int) ptr->qoperand.valcrc) % TSQS_SIGLEN);
ptr++;
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.14 2010/08/03 00:10:39 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.15 2010/08/03 01:50:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
else if (operand)
{
node->word = operand + in->qoperand.distance;
- node->sign = 1 << (in->qoperand.valcrc % 32);
+ node->sign = ((uint32) 1) << (((unsigned int) in->qoperand.valcrc) % 32);
}
return node;