[pypy-svn] r65070 - in pypy/branch/pyjitpl5/pypy/jit/metainterp: . test

antocuni at codespeak.net antocuni at codespeak.net
Tue May 5 21:57:12 CEST 2009


Author: antocuni
Date: Tue May  5 21:57:10 2009
New Revision: 65070

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_dict.py
Log:
don't try to pass void arguments to oosend


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py	Tue May  5 21:57:10 2009
@@ -1116,7 +1116,9 @@
         methdescr = self.codewriter.get_methdescr(SELFTYPE, methname, False)
         self.emit('residual_oosend' + kind)
         self.emit(self.get_position(methdescr))
-        self.emit_varargs(op.args[1:])
+        non_void_args = [arg for arg in op.args[1:]
+                         if arg.concretetype is not ootype.Void]
+        self.emit_varargs(non_void_args)
         self.register_var(op.result)
 
     def handle_residual_oosend(self, op):

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_dict.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_dict.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_dict.py	Tue May  5 21:57:10 2009
@@ -4,6 +4,14 @@
 
 class DictTests:
 
+    def test_dict_set_none(self):
+        def fn(n):
+            d = {}
+            d[0] = None
+            return bool(d[n])
+        res = self.interp_operations(fn, [0])
+        assert not res
+
     def test_dict_keys_values_items(self):
         for name, extract, expected in [('keys', None, 'k'),
                                         ('values', None, 'v'),



More information about the Pypy-commit mailing list