
Hi, I've just found a bug in lltypesystem; to reproduce type the following in translatorshell.py: line 108, in _execute res = self._do(goal, taskcallable, *args, **kwds) File "/home/anto/pypy/pypy-dist/pypy/translator/driver.py", line 140, in _do res = func() File "/home/anto/pypy/pypy-dist/pypy/translator/driver.py", line 186, in task_rtype crash_on_first_typeerror=not opt.insist) File "/home/anto/pypy/pypy-dist/pypy/rpython/rtyper.py", line 144, in specialize self.specialize_more_blocks() File "/home/anto/pypy/pypy-dist/pypy/rpython/rtyper.py", line 175, in specialize_more_blocks self.specialize_block(block) File "/home/anto/pypy/pypy-dist/pypy/rpython/rtyper.py", line 286, in specialize_block self.translate_hl_to_ll(hop, varmapping) File "/home/anto/pypy/pypy-dist/pypy/rpython/rtyper.py", line 413, in translate_hl_to_ll resultvar = hop.dispatch() File "/home/anto/pypy/pypy-dist/pypy/rpython/rtyper.py", line 625, in dispatch return translate_meth(self) File "None</fat/pypy/pypy-dist/py/code/source.py:215>", line 5, in translate_op_truediv File "/home/anto/pypy/pypy-dist/pypy/rpython/rint.py", line 93, in rtype_truediv return _rtype_template(hop, 'truediv', [ZeroDivisionError]) File "/home/anto/pypy/pypy-dist/pypy/rpython/rint.py", line 186, in _rtype_template return hop.genop(repr.opprefix+func, vlist, resulttype=repr) File "/home/anto/pypy/pypy-dist/pypy/rpython/rmodel.py", line 102, in __getattr__ raise AttributeError("%s instance has no attribute %s" % ( AttributeError: FloatRepr instance has no attribute opprefix
ciao Anto

Hi Antonio, On Thu, Mar 23, 2006 at 10:33:52PM +0100, Antonio Cuni wrote:
Thanks. I've fixed this and cleaned up a bit the div / floordiv / truediv mess that we have in low-level operations. Now there is only 'int_floordiv' (and uint_floordiv, llong_floordiv...) for integer types, and 'float_truediv' for floats. In the example you give, the RTyper now introduces conversions from int to float of both x and y before using 'float_truediv'. (Interestingly, this is done by removing all references to 'truediv' from IntegerRepr and letting it fall back to its superclass FloatRepr.) A bientot, Armin

Hi Antonio, On Thu, Mar 23, 2006 at 10:33:52PM +0100, Antonio Cuni wrote:
Thanks. I've fixed this and cleaned up a bit the div / floordiv / truediv mess that we have in low-level operations. Now there is only 'int_floordiv' (and uint_floordiv, llong_floordiv...) for integer types, and 'float_truediv' for floats. In the example you give, the RTyper now introduces conversions from int to float of both x and y before using 'float_truediv'. (Interestingly, this is done by removing all references to 'truediv' from IntegerRepr and letting it fall back to its superclass FloatRepr.) A bientot, Armin
participants (2)
-
Antonio Cuni
-
Armin Rigo