Author: Richard Plangger <[email protected]>
Branch: 
Changeset: r84413:63940d0c6eee
Date: 2016-05-13 07:59 +0200
http://bitbucket.org/pypy/pypy/changeset/63940d0c6eee/

Log:    arg. translation issue (non negative indices)

diff --git a/rpython/memory/gc/env.py b/rpython/memory/gc/env.py
--- a/rpython/memory/gc/env.py
+++ b/rpython/memory/gc/env.py
@@ -242,11 +242,11 @@
                 break
             linepos = end
             size = data[start:end]
-            if size[len(size)-1] not in ('K', 'k'):    # assume kilobytes for 
now
+            last_char = len(size)-1
+            assert 0 <= last_char < len(size)
+            if size[last_char] not in ('K', 'k'):    # assume kilobytes for now
                 continue
-            last = len(size) - 1
-            assert last >= 0
-            number = int(size[:last]) * 1024
+            number = int(size[:last_char])* 1024
             # for now we look for the smallest of the L2 caches of the CPUs
             if number < L2cache:
                 L2cache = number
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to