Backport r247375
2017-06-22 Martin Liska <mliska@suse.cz> Backport from mainline 2017-04-28 Martin Liska <mliska@suse.cz> PR gcov-profile/53915 * gcov.c (format_gcov): Print 'NAN %' when top > bottom. From-SVN: r249541
This commit is contained in:
parent
ed4635ea72
commit
2f5b8b6d6f
|
@ -1,3 +1,11 @@
|
|||
2017-06-22 Martin Liska <mliska@suse.cz>
|
||||
|
||||
Backport from mainline
|
||||
2017-04-28 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR gcov-profile/53915
|
||||
* gcov.c (format_gcov): Print 'NAN %' when top > bottom.
|
||||
|
||||
2017-06-22 Martin Liska <mliska@suse.cz>
|
||||
|
||||
Backport from mainline
|
||||
|
|
|
@ -1959,6 +1959,13 @@ format_gcov (gcov_type top, gcov_type bottom, int dp)
|
|||
{
|
||||
static char buffer[20];
|
||||
|
||||
/* Handle invalid values that would result in a misleading value. */
|
||||
if (bottom != 0 && top > bottom && dp >= 0)
|
||||
{
|
||||
sprintf (buffer, "NAN %%");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
if (dp >= 0)
|
||||
{
|
||||
float ratio = bottom ? (float)top / bottom : 0;
|
||||
|
|
Loading…
Reference in New Issue