[pypy-svn] r22844 - pypy/branch/genc-gc-refactoring

mwh at codespeak.net mwh at codespeak.net
Sun Jan 29 15:28:50 CET 2006


Author: mwh
Date: Sun Jan 29 15:28:48 2006
New Revision: 22844

Modified:
   pypy/branch/genc-gc-refactoring/gc.py
Log:
don't try and incref NULL (grumble)


Modified: pypy/branch/genc-gc-refactoring/gc.py
==============================================================================
--- pypy/branch/genc-gc-refactoring/gc.py	(original)
+++ pypy/branch/genc-gc-refactoring/gc.py	Sun Jan 29 15:28:48 2006
@@ -287,6 +287,8 @@
 
     def OP_GC_PUSH_ALIVE(self, funcgen, op, err):
         expr = funcgen.expr(op.args[0])
+        if expr == 'NULL':
+            return ''
         defnode = self.db.gettypedefnode(op.args[0].concretetype.TO)
         assert defnode.gcheader is not None
         return 'pypy_IncRf_%s(%s);' % (defnode.barename, expr)
@@ -299,6 +301,8 @@
         
     def OP_GC_PUSH_ALIVE_PYOBJ(self, funcgen, op, err):
         expr = funcgen.expr(op.args[0])
+        if expr == 'NULL':
+            return ''
         return 'Py_XINCREF(%s);' % expr
 
     def OP_GC_POP_ALIVE_PYOBJ(self, funcgen, op, err):



More information about the Pypy-commit mailing list