[pypy-commit] pypy default: arg. translation issue (non negative indices)
plan_rich
pypy.commits at gmail.com
Fri May 13 01:59:51 EDT 2016
Author: Richard Plangger <planrichi at gmail.com>
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
More information about the pypy-commit
mailing list