[pypy-dev] [pypy-svn] r47380 - pypy/dist/pypy/translator/c/test
Amaury Forgeot d'Arc
amauryfa at gmail.com
Wed Oct 10 19:30:29 CEST 2007
Hello,
> Modified:
> pypy/dist/pypy/translator/c/test/test_typed.py
> Log:
> this test breaks the c backend in a curious way
I think I found the reason: in gen_assignments(), variable names are
compared by reference, but source and destination names are are
constructed in different ways.
I propose the following patch:
Index: pypy/translator/c/support.py
===================================================================
--- pypy/translator/c/support.py (revision 47380)
+++ pypy/translator/c/support.py (working copy)
@@ -205,7 +205,7 @@
startingpoint = dst
tmpdecl = cdecl(typename, 'tmp')
code = ['{ %s = %s;' % (tmpdecl, dst)]
- while src is not startingpoint:
+ while src != startingpoint:
code.append('%s = %s;' % (dst, src))
dst = src
src, typename = dest2src.pop(dst)
--
Amaury Forgeot d'Arc
More information about the Pypy-dev
mailing list