]> git.eshelyaron.com Git - emacs.git/commitdiff
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 b2a8f81f3a6f820dd7e9296eb9c2042ec7267bc0..f3cc322636c7f61d78ae13fbab97c77186079655 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 7c63fa05ac67fecbea25937b31700d9d24821032..a007a43457d71865e0f49b61c1e2d28cf529e7cc 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);
             }
         }