[llvm-commits] [zorg] r130465 - /zorg/trunk/lnt/lnt/viewer/GraphUtil.py

Daniel Dunbar daniel at zuster.org
Thu Apr 28 17:28:42 PDT 2011


Author: ddunbar
Date: Thu Apr 28 19:28:42 2011
New Revision: 130465

URL: http://llvm.org/viewvc/llvm-project?rev=130465&view=rev
Log:
LNT: Fix a possible zero division error.

Modified:
    zorg/trunk/lnt/lnt/viewer/GraphUtil.py

Modified: zorg/trunk/lnt/lnt/viewer/GraphUtil.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/GraphUtil.py?rev=130465&r1=130464&r2=130465&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/GraphUtil.py (original)
+++ zorg/trunk/lnt/lnt/viewer/GraphUtil.py Thu Apr 28 19:28:42 2011
@@ -85,8 +85,11 @@
 
             # We compute the regression line in terms of a normalized X scale.
             x_min, x_max = min(xs), max(xs)
-            norm_xs = [(x - x_min) / (x_max - x_min)
-                       for x in xs]
+            try:
+                norm_xs = [(x - x_min) / (x_max - x_min)
+                           for x in xs]
+            except ZeroDivisionError:
+                norm_xs = xs
 
             try:
                 info = ext_stats.linregress(norm_xs, ys)





More information about the llvm-commits mailing list