aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2024-01-21 20:34:03 -0800
committerPaul Eggert2024-01-21 21:13:39 -0800
commit088afa7e2f08f4eb4e39aae5db4faa33857bf544 (patch)
tree9724b9ec1ad7141ff592e0323ae38c244ce7c3c1 /src
parentdf7c6211cb960b88bc0aaef85babf7e9384d5f2e (diff)
downloademacs-088afa7e2f08f4eb4e39aae5db4faa33857bf544.tar.gz
emacs-088afa7e2f08f4eb4e39aae5db4faa33857bf544.zip
Add an eassert back to XSYMBOL
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)).
Diffstat (limited to 'src')
-rw-r--r--src/lisp.h7
1 files changed, 6 insertions, 1 deletions
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)
1161INLINE struct Lisp_Symbol * ATTRIBUTE_NO_SANITIZE_UNDEFINED 1161INLINE struct Lisp_Symbol * ATTRIBUTE_NO_SANITIZE_UNDEFINED
1162XSYMBOL (Lisp_Object a) 1162XSYMBOL (Lisp_Object a)
1163{ 1163{
1164 return XBARE_SYMBOL (BARE_SYMBOL_P (a) ? a : XSYMBOL_WITH_POS (a)->sym); 1164 if (!BARE_SYMBOL_P (a))
1165 {
1166 eassert (symbols_with_pos_enabled);
1167 a = XSYMBOL_WITH_POS (a)->sym;
1168 }
1169 return XBARE_SYMBOL (a);
1165} 1170}
1166 1171
1167INLINE Lisp_Object 1172INLINE Lisp_Object