Assert that function cells contain valid lisp objects
authorDaniel Colascione <dancol@dancol.org>
Thu, 3 Apr 2014 09:50:58 +0000 (02:50 -0700)
committerDaniel Colascione <dancol@dancol.org>
Thu, 3 Apr 2014 09:50:58 +0000 (02:50 -0700)
src/ChangeLog
src/alloc.c

index b2a8f81..f3cc322 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-03  Daniel Colascione  <dancol@dancol.org>
+
+       * alloc.c (sweep_symbols,mark_object): Assert that symbol function
+       cells contain valid lisp objects.  (Modified version of patch from
+       Dmitry).
+
 2014-04-03  Daniel Colascione  <dancol@dancol.org>
 
        * alloc.c (detect_suspicious_free): Split actual stack capturing
index 7c63fa0..a007a43 100644 (file)
@@ -6174,6 +6174,8 @@ mark_object (Lisp_Object arg)
          break;
        CHECK_ALLOCATED_AND_LIVE (live_symbol_p);
        ptr->gcmarkbit = 1;
+       /* Attempt to catch bogus objects.  */
+        eassert (valid_lisp_object_p (ptr->function) >= 1);
        mark_object (ptr->function);
        mark_object (ptr->plist);
        switch (ptr->redirect)
@@ -6601,6 +6603,8 @@ sweep_symbols (void)
               if (!pure_p)
                 eassert (!STRING_MARKED_P (XSTRING (sym->s.name)));
               sym->s.gcmarkbit = 0;
+              /* Attempt to catch bogus objects.  */
+              eassert (valid_lisp_object_p (sym->s.function) >= 1);
             }
         }