chiark / gitweb /
key-data.c (key_struct{set,steal}): Assert no other references.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 23 Jan 2012 02:37:40 +0000 (02:37 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 23 Jan 2012 02:37:40 +0000 (02:37 +0000)
Otherwise I predict serious trouble when someone gets the reference
counting wrong.

key-data.c

index 43ad9019cba1e2ac33b8a62ae22f204c88f860e9..0e79b32bea05df539b9e6fd3873279d8bb9ed4e8 100644 (file)
@@ -350,6 +350,7 @@ static void structset(key_data *k, int stealp,
   unsigned f;
 
   assert(((void)"Key is not structured", k->e == KENC_STRUCT));
+  assert(((void)"Key has multiple references", k->ref == 1));
   if (!kd) {
     ks = sym_find(&k->u.s, tag, -1, 0, 0);
     if (ks) sym_remove(&k->u.s, ks);