[pypy-svn] r47798 - pypy/dist/pypy/translator/backendopt

arigo at codespeak.net arigo at codespeak.net
Wed Oct 24 10:41:37 CEST 2007


Author: arigo
Date: Wed Oct 24 10:41:36 2007
New Revision: 47798

Modified:
   pypy/dist/pypy/translator/backendopt/constfold.py
Log:
Check tryfold before trying to constant-fold.
This avoids constant-folding debug_print...


Modified: pypy/dist/pypy/translator/backendopt/constfold.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/constfold.py	(original)
+++ pypy/dist/pypy/translator/backendopt/constfold.py	Wed Oct 24 10:41:36 2007
@@ -31,7 +31,7 @@
         except AttributeError:
             sideeffects = True
         else:
-            if len(args) == len(vargs):
+            if op.tryfold and len(args) == len(vargs):
                 RESTYPE = spaceop.result.concretetype
                 try:
                     result = op(RESTYPE, *args)



More information about the Pypy-commit mailing list