From 093515ae0db64058b0948dac5a42e9f72e06bcaa Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 21 Aug 2019 22:19:03 -0700 Subject: [PATCH 1/2] =?UTF-8?q?Don=E2=80=99t=20debug=20fset=20by=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This GC bug seems to have been fixed, so the check is no longer needed in production code. From a suggestion by Pip Cet in: https://lists.gnu.org/r/emacs-devel/2019-08/msg00316.html * src/alloc.c (SUSPICIOUS_OBJECT_CHECKING) [!ENABLE_CHECKING]: Do not define. (find_suspicious_object_in_range, detect_suspicious_free): Expand to proper dummy expressions if !SUSPICIOUS_OBJECT_CHECKING. * src/data.c (Ffset): Convert test to an eassert. --- src/alloc.c | 12 ++++-------- src/data.c | 5 +---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 53af7325f4..39964c4b29 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -302,15 +302,11 @@ #define PUREBEG (char *) pure const char *pending_malloc_warning; -#if 0 /* Normally, pointer sanity only on request... */ +/* Pointer sanity only on request. FIXME: Code depending on + SUSPICIOUS_OBJECT_CHECKING is obsolete; remove it entirely. */ #ifdef ENABLE_CHECKING #define SUSPICIOUS_OBJECT_CHECKING 1 #endif -#endif - -/* ... but unconditionally use SUSPICIOUS_OBJECT_CHECKING while the GC - bug is unresolved. */ -#define SUSPICIOUS_OBJECT_CHECKING 1 #ifdef SUSPICIOUS_OBJECT_CHECKING struct suspicious_free_record @@ -327,8 +323,8 @@ #define SUSPICIOUS_OBJECT_CHECKING 1 static void *find_suspicious_object_in_range (void *begin, void *end); static void detect_suspicious_free (void *ptr); #else -# define find_suspicious_object_in_range(begin, end) NULL -# define detect_suspicious_free(ptr) (void) +# define find_suspicious_object_in_range(begin, end) ((void *) NULL) +# define detect_suspicious_free(ptr) ((void) 0) #endif /* Maximum amount of C stack to save when a GC happens. */ diff --git a/src/data.c b/src/data.c index 8344bfdd3d..2797adfcdc 100644 --- a/src/data.c +++ b/src/data.c @@ -771,10 +771,7 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0, if (AUTOLOADP (function)) Fput (symbol, Qautoload, XCDR (function)); - /* Convert to eassert or remove after GC bug is found. In the - meantime, check unconditionally, at a slight perf hit. */ - if (! valid_lisp_object_p (definition)) - emacs_abort (); + eassert (valid_lisp_object_p (definition)); set_symbol_function (symbol, definition); -- 2.17.1