From e3f04a4a8f439dee381d8e6d0c55c684107c1a55 Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Thu, 3 Apr 2014 02:50:58 -0700 Subject: [PATCH] Assert that function cells contain valid lisp objects --- src/ChangeLog | 6 ++++++ src/alloc.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index b2a8f81f3a6..f3cc322636c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-04-03 Daniel Colascione + + * 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 * alloc.c (detect_suspicious_free): Split actual stack capturing diff --git a/src/alloc.c b/src/alloc.c index 7c63fa05ac6..a007a43457d 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -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); } } -- 2.39.5