[pypy-commit] pypy default: maybe a fix for gc tests, we will see

fijal pypy.commits at gmail.com
Thu Feb 8 08:27:39 EST 2018


Author: fijal
Branch: 
Changeset: r93786:cc02e211a1a3
Date: 2018-02-08 14:26 +0100
http://bitbucket.org/pypy/pypy/changeset/cc02e211a1a3/

Log:	maybe a fix for gc tests, we will see

diff --git a/rpython/memory/gctypelayout.py b/rpython/memory/gctypelayout.py
--- a/rpython/memory/gctypelayout.py
+++ b/rpython/memory/gctypelayout.py
@@ -1,4 +1,4 @@
-from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup
+from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup, rffi
 from rpython.rtyper import rclass
 from rpython.rtyper.lltypesystem.lloperation import llop
 from rpython.rlib.debug import ll_assert
@@ -96,6 +96,8 @@
         return llmemory.cast_adr_to_ptr(adr, lltype.Ptr(FIN_HANDLER_ARRAY))
 
     def q_destructor_or_custom_trace(self, typeid):
+        if not self.get(typeid).customdata:
+            return lltype.nullptr(rffi.VOIDP.TO)
         return self.get(typeid).customdata.customfunc
 
     def q_is_old_style_finalizer(self, typeid):


More information about the pypy-commit mailing list