Author: Remi Meier <meier...@student.ethz.ch>
Branch: 
Changeset: r283:2e4480dc9707
Date: 2013-06-25 17:51 +0200
http://bitbucket.org/pypy/stmgc/changeset/2e4480dc9707/

Log:    fix validation of priv_from_prot

diff --git a/c4/demo_random.c b/c4/demo_random.c
--- a/c4/demo_random.c
+++ b/c4/demo_random.c
@@ -330,6 +330,14 @@
             p = (gcptr)(((nodeptr)read_barrier(p))->next);
         break;
     case 9: // XXX: rare events
+        k = get_rand(10);
+        if (k == 1) {
+            push_roots();
+            stm_push_root(p);
+            stm_become_inevitable("fun");
+            p = stm_pop_root();
+            pop_roots();
+        }
         break;
     case 10: // only do a stm_read_barrier
         p = read_barrier(p);
diff --git a/c4/et.c b/c4/et.c
--- a/c4/et.c
+++ b/c4/et.c
@@ -652,12 +652,17 @@
             {
               /* such an object R might be listed in list_of_read_objects
                  before it was turned from protected to private */
-              continue;
+              if(((gcptr)v)->h_tid & GCFLAG_BACKUP_COPY)
+                continue;
+              /* the backup was stolen */
+              return 0; 
             }
           else if ((R->h_tid & (GCFLAG_PUBLIC | GCFLAG_NURSERY_MOVED))
                             == (GCFLAG_PUBLIC | GCFLAG_NURSERY_MOVED))
             {
-              /* such an object is identical to the one it points to */
+              /* such an object is identical to the one it points to
+               (stolen protected young object with h_revision pointing
+               to the new copy) */
               R = (gcptr)v;
               goto retry;
             }
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to