[pypy-commit] pypy gc-incminimark-pinning: Fix the case of _make_sure_does_not_move with NULL

fijal noreply at buildbot.pypy.org
Fri Oct 24 13:44:20 CEST 2014


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: gc-incminimark-pinning
Changeset: r74160:5fa46dae2ebe
Date: 2014-10-24 13:44 +0200
http://bitbucket.org/pypy/pypy/changeset/5fa46dae2ebe/

Log:	Fix the case of _make_sure_does_not_move with NULL

diff --git a/rpython/rlib/rgc.py b/rpython/rlib/rgc.py
--- a/rpython/rlib/rgc.py
+++ b/rpython/rlib/rgc.py
@@ -151,6 +151,7 @@
     Warning: should ideally only be used with the minimark GC, and only
     on objects that are already a bit old, so have a chance to be
     already non-movable."""
+    assert p
     if not we_are_translated():
         # for testing purpose
         return not _is_pinned(p)
diff --git a/rpython/rlib/rthread.py b/rpython/rlib/rthread.py
--- a/rpython/rlib/rthread.py
+++ b/rpython/rlib/rthread.py
@@ -313,7 +313,8 @@
                 ptr = cast_instance_to_base_ptr(value)
                 if not running_on_llinterp:
                     gcref = lltype.cast_opaque_ptr(llmemory.GCREF, ptr)
-                    _make_sure_does_not_move(gcref)
+                    if gcref:
+                        _make_sure_does_not_move(gcref)
                 llop.threadlocalref_set(lltype.Void, opaque_id, ptr)
                 ensure_threadlocal()
             else:


More information about the pypy-commit mailing list