Fix order of inferiors in "thread apply all"

This inserts missing parentheses in the calculation of the comparison
result between two different inferior numbers.  The problem was found by
Philipp Rudo.

gdb/ChangeLog:

	* thread.c (tp_array_compar): Insert missing parentheses.

gdb/testsuite/ChangeLog:

	* gdb.multi/tids.exp: Test "thread apply all".
This commit is contained in:
Andreas Arnez 2016-08-30 17:03:55 +02:00
parent b2b383620e
commit 5af962df4d
4 changed files with 15 additions and 1 deletions

View file

@ -1725,7 +1725,7 @@ tp_array_compar (const void *ap_voidp, const void *bp_voidp)
if (a->inf->num != b->inf->num)
{
return ((a->inf->num > b->inf->num) - (a->inf->num < b->inf->num)
return (((a->inf->num > b->inf->num) - (a->inf->num < b->inf->num))
* (tp_array_compar_ascending ? +1 : -1));
}