summaryrefslogtreecommitdiff
path: root/src/lread.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-10-23 02:43:17 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-10-23 02:43:17 -0700
commit6129cd03e20a0aaee46ceb742a9ed1ae2904eab3 (patch)
treef432bbffba80979cec74cfc125a9f73abfd06a91 /src/lread.c
parent16d126d7559c2f58c8af6cf86c9f54b6e21cceb4 (diff)
parentb73f4668ab685dfb690eced15b20ed47f90efccb (diff)
downloademacs-6129cd03e20a0aaee46ceb742a9ed1ae2904eab3.tar.gz
Merge from origin/emacs-25
b73f466 * lisp/cus-start.el (exec-path): Handle nil elements. (Bug#2... 55ebb70 Catch the imenu-unavailable error in sh-mode completion table 993acb5 ; Minor fix for last change in characters.el 30c4bb5 More char-width fixes 4eb4463 Fix char-width-table values for some Emoji 528997d Keep point when switching from and to *terminal* buffer 2130005 * INSTALL: Use correct Emacs release number 25. 10835b1 Avoid crashes due to objects read with the #n=object form 4de671d Improve doc string of 'completion-at-point-functions' ceb46f0 Fix crash in evaluating functions d8374c4 * src/filelock.c (current_lock_owner): Update comment.
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c
index 10eec3b1be0..58d518ce40b 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2917,7 +2917,18 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
if (c == '=')
{
/* Make a placeholder for #n# to use temporarily. */
- AUTO_CONS (placeholder, Qnil, Qnil);
+ /* Note: We used to use AUTO_CONS to allocate
+ placeholder, but that is a bad idea, since it
+ will place a stack-allocated cons cell into
+ the list in read_objects, which is a
+ staticpro'd global variable, and thus each of
+ its elements is marked during each GC. A
+ stack-allocated object will become garbled
+ when its stack slot goes out of scope, and
+ some other function reuses it for entirely
+ different purposes, which will cause crashes
+ in GC. */
+ Lisp_Object placeholder = Fcons (Qnil, Qnil);
Lisp_Object cell = Fcons (make_number (n), placeholder);
read_objects = Fcons (cell, read_objects);