]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
fix division by zeros
authorDirk Mueller <daywalker@users.sourceforge.net>
Fri, 14 Sep 2007 09:02:43 +0000 (09:02 +0000)
committerDirk Mueller <daywalker@users.sourceforge.net>
Fri, 14 Sep 2007 09:02:43 +0000 (09:02 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_2_BRANCH@6831

massif/ms_main.c

index 9464ec3ebc4db5d882514feb774a54c6a11a33d5..ad122ddd9dcef101f52ee1fa98b1ee094e2b8e95 100644 (file)
@@ -1665,15 +1665,18 @@ print_summary(ULong total_ST, ULong heap_ST, ULong heap_admin_ST,
    if (VG_(clo_verbosity) > 1) {
       tl_assert(n_xpts > 0);  // always have alloc_xpt
       VG_(message)(Vg_DebugMsg, "    allocs: %u", n_allocs);
-      VG_(message)(Vg_DebugMsg, "zeroallocs: %u (%d%%)", n_zero_allocs,
-                                n_zero_allocs * 100 / n_allocs );
+      if ( n_allocs )
+         VG_(message)(Vg_DebugMsg, "zeroallocs: %u (%d%%)", n_zero_allocs,
+                                   n_zero_allocs * 100 / n_allocs );
       VG_(message)(Vg_DebugMsg, "     frees: %u", n_frees);
       VG_(message)(Vg_DebugMsg, "      XPts: %u (%d B)", n_xpts,
                                                          n_xpts*sizeof(XPt));
-      VG_(message)(Vg_DebugMsg, "  bot-XPts: %u (%d%%)", n_bot_xpts,
-                                n_bot_xpts * 100 / n_xpts);
-      VG_(message)(Vg_DebugMsg, "  top-XPts: %u (%d%%)", alloc_xpt->n_children,
-                                alloc_xpt->n_children * 100 / n_xpts);
+      if ( n_xpts ) 
+         VG_(message)(Vg_DebugMsg, "  bot-XPts: %u (%d%%)", n_bot_xpts,
+                                   n_bot_xpts * 100 / n_xpts);
+      if ( n_xpts )
+         VG_(message)(Vg_DebugMsg, "  top-XPts: %u (%d%%)", alloc_xpt->n_children,
+                                   alloc_xpt->n_children * 100 / n_xpts);
       VG_(message)(Vg_DebugMsg, "c-reallocs: %u", n_children_reallocs);
       VG_(message)(Vg_DebugMsg, "snap-frees: %u", n_snapshot_frees);
       VG_(message)(Vg_DebugMsg, "atmp censi: %u", n_attempted_censi);