1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

Avoid crashes in malformed defvar

* src/eval.c (Fdefvar): Don't call XSYMBOL on something that
might not be a symbol.  This avoids crashes due to malformed
'defvar' forms.  (Bug#32552)
This commit is contained in:
Eli Zaretskii 2018-08-28 10:20:46 +03:00
parent 785682c26d
commit 63e59c8ca5

View File

@ -773,7 +773,7 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
LOADHIST_ATTACH (sym);
}
else if (!NILP (Vinternal_interpreter_environment)
&& !XSYMBOL (sym)->u.s.declared_special)
&& (SYMBOLP (sym) && !XSYMBOL (sym)->u.s.declared_special))
/* A simple (defvar foo) with lexical scoping does "nothing" except
declare that var to be dynamically scoped *locally* (i.e. within
the current file or let-block). */