Commit 50a2d3be by Martin Liska Committed by Martin Liska

Fix unsigned type overflow in memory report.

2019-10-29  Martin Liska  <mliska@suse.cz>

	* ggc-common.c: One can't subtract unsigned types
	in compare function.

From-SVN: r277560
parent 3518424d
2019-10-29 Martin Liska <mliska@suse.cz>
* ggc-common.c: One can't subtract unsigned types
in compare function.
2019-10-29 Martin Liska <mliska@suse.cz>
* cgraphunit.c (symbol_table::compile): Pass
title as dump_memory_report argument.
* toplev.c (dump_memory_report): New argument.
......@@ -928,10 +928,13 @@ public:
static int
compare (const void *first, const void *second)
{
const mem_pair_t f = *(const mem_pair_t *)first;
const mem_pair_t s = *(const mem_pair_t *)second;
const mem_pair_t mem1 = *(const mem_pair_t *) first;
const mem_pair_t mem2 = *(const mem_pair_t *) second;
return s.second->get_balance () - f.second->get_balance ();
size_t balance1 = mem1.second->get_balance ();
size_t balance2 = mem2.second->get_balance ();
return balance1 == balance2 ? 0 : (balance1 < balance2 ? 1 : -1);
}
/* Dump header with NAME. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment