Author: Maciej Fijalkowski <[email protected]>
Branch: vmprof
Changeset: r76084:d4794a390ef8
Date: 2015-02-23 17:41 +0200
http://bitbucket.org/pypy/pypy/changeset/d4794a390ef8/
Log: (arigo,fijal) bleh, fix the logic
diff --git a/rpython/jit/backend/llsupport/codemap.py
b/rpython/jit/backend/llsupport/codemap.py
--- a/rpython/jit/backend/llsupport/codemap.py
+++ b/rpython/jit/backend/llsupport/codemap.py
@@ -73,18 +73,16 @@
used = getattr(self, name + '_used')
allocated = len(getattr(self, name))
lst = getattr(self, name)
- if pos + len(to_insert) >= allocated or pos != used:
+ if pos + len(to_insert) > allocated or pos != used:
old_lst = lst
- if pos == used:
+ if pos + len(to_insert) > allocated:
new_size = max(4 * len(old_lst),
(len(old_lst) + len(to_insert)) * 2)
- lst = lltype.malloc(lltype.typeOf(lst).TO, new_size,
- flavor='raw',
- track_allocation=self.track_allocation)
else:
- lst = lltype.malloc(lltype.typeOf(lst).TO, len(old_lst),
- flavor='raw',
- track_allocation=self.track_allocation)
+ new_size = len(old_lst)
+ lst = lltype.malloc(lltype.typeOf(lst).TO, new_size,
+ flavor='raw',
+ track_allocation=self.track_allocation)
for i in range(0, pos):
copy_item(old_lst, lst, i, i)
j = 0
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit