2017-04-28 Martin Liska <mliska@suse.cz>
PR gcov-profile/53915
* gcov.c (format_gcov): Print 'NAN %' when top > bottom.
From-SVN: r247375
+2017-04-28 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/53915
+ * gcov.c (format_gcov): Print 'NAN %' when top > bottom.
+
2017-04-28 Martin Liska <mliska@suse.cz>
PR gcov-profile/79891
{
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;