[pypy-commit] pypy default: Fix an obscure issue where destructed SHADOWSTACKREFs could still be

arigo noreply at buildbot.pypy.org
Thu Mar 28 02:33:16 CET 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r62849:a51c7cc17f48
Date: 2013-03-27 20:06 +0100
http://bitbucket.org/pypy/pypy/changeset/a51c7cc17f48/

Log:	Fix an obscure issue where destructed SHADOWSTACKREFs could still be
	occasionally traced, leading to crashes.

diff --git a/rpython/memory/gctransform/shadowstack.py b/rpython/memory/gctransform/shadowstack.py
--- a/rpython/memory/gctransform/shadowstack.py
+++ b/rpython/memory/gctransform/shadowstack.py
@@ -397,7 +397,11 @@
         from rpython.rlib import _rffi_stacklet as _c
         h = shadowstackref.context
         h = llmemory.cast_adr_to_ptr(h, _c.handle)
-        llmemory.raw_free(shadowstackref.base)
+        base = shadowstackref.base
+        shadowstackref.base    = llmemory.NULL
+        shadowstackref.top     = llmemory.NULL
+        shadowstackref.context = llmemory.NULL
+        llmemory.raw_free(base)
         if h:
             _c.destroy(h)
 


More information about the pypy-commit mailing list