[pypy-commit] pypy stmgc-c7-rewindjmp: Accept set(NULL)

arigo noreply at buildbot.pypy.org
Thu Aug 14 17:32:49 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7-rewindjmp
Changeset: r72804:0d4e673c7370
Date: 2014-08-14 17:31 +0200
http://bitbucket.org/pypy/pypy/changeset/0d4e673c7370/

Log:	Accept set(NULL)

diff --git a/rpython/rlib/rthread.py b/rpython/rlib/rthread.py
--- a/rpython/rlib/rthread.py
+++ b/rpython/rlib/rthread.py
@@ -322,8 +322,9 @@
                 from rpython.rlib.objectmodel import running_on_llinterp
                 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 ptr:
+                        gcref = lltype.cast_opaque_ptr(llmemory.GCREF, ptr)
+                        _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