[pypy-commit] pypy default: this fixes the test, but we're getting into a dangerous territory here

fijal noreply at buildbot.pypy.org
Sat Sep 24 23:16:32 CEST 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r47590:3d8b5c3c699e
Date: 2011-09-24 18:16 -0300
http://bitbucket.org/pypy/pypy/changeset/3d8b5c3c699e/

Log:	this fixes the test, but we're getting into a dangerous territory
	here

diff --git a/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py b/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
--- a/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
+++ b/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
@@ -4789,7 +4789,6 @@
         self.optimize_strunicode_loop(ops, expected)
 
 
-
 class TestLLtype(BaseTestOptimizeBasic, LLtypeMixin):
     pass
 
diff --git a/pypy/jit/metainterp/optimizeopt/vstring.py b/pypy/jit/metainterp/optimizeopt/vstring.py
--- a/pypy/jit/metainterp/optimizeopt/vstring.py
+++ b/pypy/jit/metainterp/optimizeopt/vstring.py
@@ -141,6 +141,11 @@
                                    for c in self._chars])
 
     def string_copy_parts(self, optimizer, targetbox, offsetbox, mode):
+        if not self.is_virtual() and targetbox is not self.box:
+            lengthbox = self.getstrlen(optimizer, mode)
+            srcbox = self.force_box()
+            return copy_str_content(optimizer, srcbox, targetbox,
+                                CONST_0, offsetbox, lengthbox, mode)
         for i in range(len(self._chars)):
             charbox = self._chars[i].force_box()
             if not (isinstance(charbox, Const) and charbox.same_constant(CONST_0)):


More information about the pypy-commit mailing list