[pypy-commit] pypy default: add an assert.

arigo noreply at buildbot.pypy.org
Thu Dec 15 13:23:50 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r50548:e790db7af776
Date: 2011-12-15 13:01 +0100
http://bitbucket.org/pypy/pypy/changeset/e790db7af776/

Log:	add an assert.

diff --git a/pypy/jit/metainterp/warmstate.py b/pypy/jit/metainterp/warmstate.py
--- a/pypy/jit/metainterp/warmstate.py
+++ b/pypy/jit/metainterp/warmstate.py
@@ -166,6 +166,7 @@
             # The latest_generation_seen is older than the current generation.
             # Adjust by multiplying self.counter N times by decay_factor, i.e.
             # by decay_factor ** N, which is equal to exp(log(decay_factor)*N).
+            assert self.counter >= 0
             N = generation - self.latest_generation_seen
             factor = math.exp(log_decay_factor * N)
             self.counter = int(self.counter * factor)


More information about the pypy-commit mailing list