[pypy-svn] r54019 - pypy/dist/pypy/translator/c
arigo at codespeak.net
arigo at codespeak.net
Tue Apr 22 17:21:20 CEST 2008
Author: arigo
Date: Tue Apr 22 17:21:20 2008
New Revision: 54019
Modified:
pypy/dist/pypy/translator/c/funcgen.py
Log:
Found a (large) case in which heapblock.operations is empty,
causing invalid C code to be generated. (but C sucks)
Modified: pypy/dist/pypy/translator/c/funcgen.py
==============================================================================
--- pypy/dist/pypy/translator/c/funcgen.py (original)
+++ pypy/dist/pypy/translator/c/funcgen.py Tue Apr 22 17:21:20 2008
@@ -375,9 +375,12 @@
for op in self.gen_link(enterlink):
yield '\t' + op
yield '\t block%d_back:' % self.blocknum[headblock]
- for i, op in enumerate(headblock.operations):
- for line in self.gen_op(op):
- yield '\t' + line
+ if headblock.operations:
+ for i, op in enumerate(headblock.operations):
+ for line in self.gen_op(op):
+ yield '\t' + line
+ else:
+ yield '\t;'
yield '}'
for op in self.gen_link(exitlink):
yield op
More information about the Pypy-commit
mailing list