[pypy-commit] pypy stm-gc: More asserts

arigo noreply at buildbot.pypy.org
Mon Apr 16 21:23:00 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r54442:d5653c635122
Date: 2012-04-16 21:18 +0200
http://bitbucket.org/pypy/pypy/changeset/d5653c635122/

Log:	More asserts

diff --git a/pypy/rpython/memory/gc/stmtls.py b/pypy/rpython/memory/gc/stmtls.py
--- a/pypy/rpython/memory/gc/stmtls.py
+++ b/pypy/rpython/memory/gc/stmtls.py
@@ -399,6 +399,18 @@
                   "in a root: missing GCFLAG_WAS_COPIED")
         ll_assert(localhdr.tid & GCFLAG_VISITED != 0,
                   "in a root: missing GCFLAG_VISITED")
+        globalhdr = self.gc.header(globalobj)
+        ll_assert(globalhdr.tid & GCFLAG_GLOBAL != 0,
+                  "in a root: GLOBAL: missing GCFLAG_GLOBAL")
+        ll_assert(globalhdr.tid & GCFLAG_WAS_COPIED != 0,
+                  "in a root: GLOBAL: missing GCFLAG_WAS_COPIED")
+        ll_assert(globalhdr.tid & GCFLAG_VISITED == 0,
+                  "in a root: GLOBAL: unexpected GCFLAG_VISITED")
+        TL = lltype.cast_primitive(lltype.Signed,
+                                   self.gc.get_type_id(localobj))
+        TG = lltype.cast_primitive(lltype.Signed,
+                                   self.gc.get_type_id(globalobj))
+        ll_assert(TL == TG, "in a root: type(LOCAL) != type(GLOBAL)")
         #
         self.trace_and_drag_out_of_nursery(localobj)
 


More information about the pypy-commit mailing list