From fd40a16a694cc7d17703384f4b2304e8fcc78e4a Mon Sep 17 00:00:00 2001
From: uid245 <unknown>
Date: Thu, 9 Oct 1997 09:33:07 +0000
Subject: [PATCH] [project @ 1997-10-09 09:33:07 by uid245] avoid another
 divide by zero.

---
 ghc/runtime/storage/SMstats.lc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ghc/runtime/storage/SMstats.lc b/ghc/runtime/storage/SMstats.lc
index f67c4e7ae16d..90349dcc15e6 100644
--- a/ghc/runtime/storage/SMstats.lc
+++ b/ghc/runtime/storage/SMstats.lc
@@ -517,7 +517,12 @@ stat_exit(I_ alloc)
 	fprintf(sf, "  %%GC time     %5.1f%%  (%.1f%% elapsed)\n\n",
 		GC_tot_time*100./time, GCe_tot_time*100./etime);
 
-	ullong_format_string((ullong)(GC_tot_alloc*sizeof(W_)/(time - GC_tot_time)), temp, rtsTrue/*commas*/);
+	if (time - GC_tot_time == 0.0)
+		ullong_format_string((ullong)0, temp, rtsTrue/*commas*/);
+	else
+		ullong_format_string((ullong)
+			(time - GC_tot_time)), temp, rtsTrue/*commas*/);
+
 	fprintf(sf, "  Alloc rate    %s bytes per MUT second\n\n", temp);
 
 	fprintf(sf, "  Productivity %5.1f%% of total user, %.1f%% of total elapsed\n\n",
-- 
GitLab