From 64f425990488ff9b49a4322f7fb1c7801f109418 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 21 Jan 2024 20:34:03 -0800 Subject: [PATCH] Add an eassert back to XSYMBOL MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Problem reported by Alan Mackenzie in: https://lists.gnu.org/r/emacs-devel/2024-01/msg00755.html * src/lisp.h (XSYMBOL): If the arg is not a bare symbol, then eassert (symbols_with_pos_enabled). This shouldn’t affect code generated for regular builds, and could catch caller errors in debug builds. For debug builds although this slows things down XSYMBOL should still be faster than it was the day before yesterday, as there’s still no need to eassert (SYMBOLP (a)). (cherry picked from commit 088afa7e2f08f4eb4e39aae5db4faa33857bf544) --- src/lisp.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lisp.h b/src/lisp.h index 29d2a08785a..efdb3886141 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1161,7 +1161,12 @@ XBARE_SYMBOL (Lisp_Object a) INLINE struct Lisp_Symbol * ATTRIBUTE_NO_SANITIZE_UNDEFINED XSYMBOL (Lisp_Object a) { - return XBARE_SYMBOL (BARE_SYMBOL_P (a) ? a : XSYMBOL_WITH_POS (a)->sym); + if (!BARE_SYMBOL_P (a)) + { + eassert (symbols_with_pos_enabled); + a = XSYMBOL_WITH_POS (a)->sym; + } + return XBARE_SYMBOL (a); } INLINE Lisp_Object -- 2.39.5