[pypy-svn] r15339 - pypy/dist/pypy/rpython

arigo at codespeak.net arigo at codespeak.net
Fri Jul 29 13:49:32 CEST 2005


Author: arigo
Date: Fri Jul 29 13:49:30 2005
New Revision: 15339

Modified:
   pypy/dist/pypy/rpython/llinterp.py
Log:
Skip setfield and setarrayitem if the item being set is a Void.


Modified: pypy/dist/pypy/rpython/llinterp.py
==============================================================================
--- pypy/dist/pypy/rpython/llinterp.py	(original)
+++ pypy/dist/pypy/rpython/llinterp.py	Fri Jul 29 13:49:30 2005
@@ -184,13 +184,18 @@
 
     def op_setfield(self, obj, fieldname, fieldvalue):
         # obj should be pointer
-        setattr(obj, fieldname, fieldvalue)
+        FIELDTYPE = getattr(typeOf(obj).TO, fieldname)
+        if FIELDTYPE != Void:
+            setattr(obj, fieldname, fieldvalue)
 
     def op_getarrayitem(self, array, index):
         return array[index]
 
     def op_setarrayitem(self, array, index, item):
-        array[index] = item
+        # array should be a pointer
+        ITEMTYPE = typeOf(array).TO.OF
+        if ITEMTYPE != Void:
+            array[index] = item
 
     def op_direct_call(self, f, *args):
         has_callable = getattr(f._obj, '_callable', None) is not None



More information about the Pypy-commit mailing list