From: Eli Zaretskii Date: Mon, 29 Mar 2021 10:39:43 +0000 (+0300) Subject: Protect add-variable-watcher from incorrect usage X-Git-Tag: emacs-28.0.90~3102 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a1e454d6df011f2a02d3b4900dd33d1d3717c6ef;p=emacs.git Protect add-variable-watcher from incorrect usage * src/data.c (Fadd_variable_watcher): Avoid crashes if SYMBOL isn't. (Bug#47462) --- diff --git a/src/data.c b/src/data.c index 0fa491b17a1..3667b03c0e4 100644 --- a/src/data.c +++ b/src/data.c @@ -1589,6 +1589,7 @@ All writes to aliases of SYMBOL will call WATCH-FUNCTION too. */) (Lisp_Object symbol, Lisp_Object watch_function) { symbol = Findirect_variable (symbol); + CHECK_SYMBOL (symbol); set_symbol_trapped_write (symbol, SYMBOL_TRAPPED_WRITE); map_obarray (Vobarray, harmonize_variable_watchers, symbol);