Do not use bit and for conjunction of predicates (PR c/81272).

2018-02-19  Martin Liska  <mliska@suse.cz>

	PR c/81272
	* decNumber.c (decCompareOp): Do not use bit and
	for conjunction of predicates.

From-SVN: r257815
This commit is contained in:
Martin Liska 2018-02-19 19:29:20 +01:00 committed by Martin Liska
parent d48fc34a45
commit a197d3406c
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2018-02-19 Martin Liska <mliska@suse.cz>
PR c/81272
* decNumber.c (decCompareOp): Do not use bit and
for conjunction of predicates.
2018-01-03 Jakub Jelinek <jakub@redhat.com>
Update copyright years.

View File

@ -6029,11 +6029,11 @@ decNumber * decCompareOp(decNumber *res, const decNumber *lhs,
/* If total ordering then handle differing signs 'up front' */
if (op==COMPTOTAL) { /* total ordering */
if (decNumberIsNegative(lhs) & !decNumberIsNegative(rhs)) {
if (decNumberIsNegative(lhs) && !decNumberIsNegative(rhs)) {
result=-1;
break;
}
if (!decNumberIsNegative(lhs) & decNumberIsNegative(rhs)) {
if (!decNumberIsNegative(lhs) && decNumberIsNegative(rhs)) {
result=+1;
break;
}