aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2010-04-29 08:42:01 -0400
committerStefan Monnier2010-04-29 08:42:01 -0400
commitd6d2385247fd2a9cacd338ec5ff1b47787ef44fb (patch)
treeaf10b7111b8b48b618493da655909cac599968f6 /src
parenta982c7ec499d6d1571b89978bfca38e2dc464e0d (diff)
downloademacs-d6d2385247fd2a9cacd338ec5ff1b47787ef44fb.tar.gz
emacs-d6d2385247fd2a9cacd338ec5ff1b47787ef44fb.zip
Fix wrong-docstring problem introduced with hash-consing.
* eval.c (Fautoload): Set doc to a unique number rather than to 0. Remove unused var `args'. * lisp.h (XSETCARFASTINT, XSETCDRFASTINT): Remove. (LOADHIST_ATTACH): Wrap with do...while to avoid surprises for callers. * doc.c (store_function_docstring): Use XSETCAR.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/ChangeLog.425
-rw-r--r--src/doc.c2
-rw-r--r--src/eval.c9
-rw-r--r--src/lisp.h9
5 files changed, 30 insertions, 24 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e80ee7c2073..3eca5c4fda1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12010-04-29 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 Fix wrong-docstring problem introduced with hash-consing.
4 * eval.c (Fautoload): Set doc to a unique number rather than to 0.
5 Remove unused var `args'.
6 * lisp.h (XSETCARFASTINT, XSETCDRFASTINT): Remove.
7 (LOADHIST_ATTACH): Wrap with do...while to avoid surprises for callers.
8 * doc.c (store_function_docstring): Use XSETCAR.
9
12010-04-28 Glenn Morris <rgm@gnu.org> 102010-04-28 Glenn Morris <rgm@gnu.org>
2 11
3 * Makefile.in (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT): New variables. 12 * Makefile.in (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT): New variables.
diff --git a/src/ChangeLog.4 b/src/ChangeLog.4
index 7e5728fbbcd..4f5d0b29e4c 100644
--- a/src/ChangeLog.4
+++ b/src/ChangeLog.4
@@ -4329,7 +4329,7 @@
4329 4329
43301993-11-01 Richard Stallman (rms@mole.gnu.ai.mit.edu) 43301993-11-01 Richard Stallman (rms@mole.gnu.ai.mit.edu)
4331 4331
4332 * s/sunos4-1-3.h (HAVE_TERMIOS): Defined. 4332 * s/sunos4-1-3.h (HAVE_TERMIOS): Define.
4333 4333
43341993-10-25 Brian J. Fox (bfox@albert.gnu.ai.mit.edu) 43341993-10-25 Brian J. Fox (bfox@albert.gnu.ai.mit.edu)
4335 4335
@@ -4426,9 +4426,9 @@
4426 4426
4427 * Makefile.in: File removed. It is now generated by ../configure. 4427 * Makefile.in: File removed. It is now generated by ../configure.
4428 4428
4429 * Makefile.in.in (LIBES): Add $(GNULIB_VAR) again at end. This 4429 * Makefile.in.in (LIBES): Add $(GNULIB_VAR) again at end.
4430 change to ymakefile was mysteriously lost. Were any others lost 4430 This change to ymakefile was mysteriously lost.
4431 too? 4431 Were any others lost too?
4432 4432
44331993-10-02 Brian J. Fox (bfox@ai.mit.edu) 44331993-10-02 Brian J. Fox (bfox@ai.mit.edu)
4434 4434
@@ -4461,8 +4461,7 @@
4461 4461
44621993-09-24 Brian J. Fox (bfox@ai.mit.edu) 44621993-09-24 Brian J. Fox (bfox@ai.mit.edu)
4463 4463
4464 * textprop.c (validate_plist): Add declaration for `list' 4464 * textprop.c (validate_plist): Add declaration for `list' argument.
4465 argument.
4466 4465
4467 * frame.c (Fhandle_switch_frame): Doc fix. 4466 * frame.c (Fhandle_switch_frame): Doc fix.
4468 4467
@@ -4501,7 +4500,7 @@
4501 * doc.c (Fsubstitute_command_keys): Pass new arg. 4500 * doc.c (Fsubstitute_command_keys): Pass new arg.
4502 * abbrev.c (Funexpand_abbrev, Fexpand_abbrev): Pass new arg. 4501 * abbrev.c (Funexpand_abbrev, Fexpand_abbrev): Pass new arg.
4503 4502
4504 * s/aix3-2.h (AIX3_2): Defined. 4503 * s/aix3-2.h (AIX3_2): Define.
4505 * m/ibmrs6000.h (LIBS_MACHINE): Include -lrts, -liconv only if AIX3_2. 4504 * m/ibmrs6000.h (LIBS_MACHINE): Include -lrts, -liconv only if AIX3_2.
4506 4505
4507 * xterm.h (HAVE_X11R4): If AIX, do not define HAVE_X11R4. 4506 * xterm.h (HAVE_X11R4): If AIX, do not define HAVE_X11R4.
@@ -4703,13 +4702,13 @@
4703 4702
4704 * xfns.c (XScreenNumberOfScreen): New function. 4703 * xfns.c (XScreenNumberOfScreen): New function.
4705 4704
4706 * m/tek4300.h (C_DEBUG_SWITCH, SYSTEM_MALLOC): Defined. 4705 * m/tek4300.h (C_DEBUG_SWITCH, SYSTEM_MALLOC): Define.
4707 4706
4708 * m/iris4d.h (START_FILES, LIB_STANDARD): Don't define if USG5_4. 4707 * m/iris4d.h (START_FILES, LIB_STANDARD): Don't define if USG5_4.
4709 (DEFAULT_ENTRY_ADDRESS): Likewise. 4708 (DEFAULT_ENTRY_ADDRESS): Likewise.
4710 (UNEXEC): Use unexelfsgi.o if USG5_4. 4709 (UNEXEC): Use unexelfsgi.o if USG5_4.
4711 4710
4712 * s/irix5-0.h (C_SWITCH_MACHINE): Deleted. 4711 * s/irix5-0.h (C_SWITCH_MACHINE): Delete.
4713 4712
47141993-08-13 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr) 47131993-08-13 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr)
4715 4714
@@ -4809,7 +4808,7 @@
4809 4808
4810 * m/dpx2.h (HAVE_TCATTR): Macro #defined. 4809 * m/dpx2.h (HAVE_TCATTR): Macro #defined.
4811 (HAVE_CLOSEDIR): #undef to allow use of closedir in sysdep.c. 4810 (HAVE_CLOSEDIR): #undef to allow use of closedir in sysdep.c.
4812 (SIGTSTP): Commented #undef to allow use of ^Z in shell-mode. 4811 (SIGTSTP): Comment #undef to allow use of ^Z in shell-mode.
4813 (SIGNALS_VIA_CHARACTERS): #defined. 4812 (SIGNALS_VIA_CHARACTERS): #defined.
4814 4813
48151993-08-09 Paul Eggert (eggert@twinsun.com) 48141993-08-09 Paul Eggert (eggert@twinsun.com)
@@ -4849,10 +4848,10 @@
4849 and calculate position properly. 4848 and calculate position properly.
4850 4849
4851 * s/bsd4-2.h, s/bsd4-3.h, s/umax.h, s/rtu.h, s/dgux.h (HAVE_VFORK): 4850 * s/bsd4-2.h, s/bsd4-3.h, s/umax.h, s/rtu.h, s/dgux.h (HAVE_VFORK):
4852 Defined. 4851 Define.
4853 4852
4854 * ymakefile (alloc.o): Don't use DEBUG_MOLE. 4853 * ymakefile (alloc.o): Don't use DEBUG_MOLE.
4855 (DEBUG_MOLE): Deleted. 4854 (DEBUG_MOLE): Delete.
4856 * gnu-hp300: File deleted. 4855 * gnu-hp300: File deleted.
4857 4856
4858 * .gdbinit: Don't put -q in args. 4857 * .gdbinit: Don't put -q in args.
@@ -4878,7 +4877,7 @@
4878 (main): Call init_buffer, init_callproc and init_cmdargs 4877 (main): Call init_buffer, init_callproc and init_cmdargs
4879 before init_lread. 4878 before init_lread.
4880 (syms_of_emacs): Install the function, and protect the variable. 4879 (syms_of_emacs): Install the function, and protect the variable.
4881 * lisp.h (Vinvocation_directory): Declared. 4880 * lisp.h (Vinvocation_directory): Declare.
4882 * lread.c (init_lread): Normally put Vinvocation_directory 4881 * lread.c (init_lread): Normally put Vinvocation_directory
4883 at end of Vload_path, if not present already. 4882 at end of Vload_path, if not present already.
4884 4883
diff --git a/src/doc.c b/src/doc.c
index 303aed0486d..536d22c57a6 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -538,7 +538,7 @@ store_function_docstring (fun, offset)
538 { 538 {
539 tem = Fcdr (Fcdr (fun)); 539 tem = Fcdr (Fcdr (fun));
540 if (CONSP (tem) && INTEGERP (XCAR (tem))) 540 if (CONSP (tem) && INTEGERP (XCAR (tem)))
541 XSETCARFASTINT (tem, offset); 541 XSETCAR (tem, make_number (offset));
542 } 542 }
543 else if (EQ (tem, Qmacro)) 543 else if (EQ (tem, Qmacro))
544 store_function_docstring (XCDR (fun), offset); 544 store_function_docstring (XCDR (fun), offset);
diff --git a/src/eval.c b/src/eval.c
index 184455f7e7d..120365f5f57 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2134,8 +2134,6 @@ this does nothing and returns nil. */)
2134 (function, file, docstring, interactive, type) 2134 (function, file, docstring, interactive, type)
2135 Lisp_Object function, file, docstring, interactive, type; 2135 Lisp_Object function, file, docstring, interactive, type;
2136{ 2136{
2137 Lisp_Object args[4];
2138
2139 CHECK_SYMBOL (function); 2137 CHECK_SYMBOL (function);
2140 CHECK_STRING (file); 2138 CHECK_STRING (file);
2141 2139
@@ -2151,8 +2149,11 @@ this does nothing and returns nil. */)
2151 LOADHIST_ATTACH (Fcons (Qautoload, function)); 2149 LOADHIST_ATTACH (Fcons (Qautoload, function));
2152 else 2150 else
2153 /* We don't want the docstring in purespace (instead, 2151 /* We don't want the docstring in purespace (instead,
2154 Snarf-documentation should (hopefully) overwrite it). */ 2152 Snarf-documentation should (hopefully) overwrite it).
2155 docstring = make_number (0); 2153 We used to use 0 here, but that leads to accidental sharing in
2154 purecopy's hash-consing, so we use a (hopefully) unique integer
2155 instead. */
2156 docstring = make_number (XHASH (function));
2156 return Ffset (function, 2157 return Ffset (function,
2157 Fpurecopy (list5 (Qautoload, file, docstring, 2158 Fpurecopy (list5 (Qautoload, file, docstring,
2158 interactive, type))); 2159 interactive, type)));
diff --git a/src/lisp.h b/src/lisp.h
index 84e2fad4483..16953e20a04 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -721,11 +721,6 @@ struct Lisp_Cons
721#define XSETCAR(c,n) (XCAR_AS_LVALUE(c) = (n)) 721#define XSETCAR(c,n) (XCAR_AS_LVALUE(c) = (n))
722#define XSETCDR(c,n) (XCDR_AS_LVALUE(c) = (n)) 722#define XSETCDR(c,n) (XCDR_AS_LVALUE(c) = (n))
723 723
724/* For performance: Fast storage of positive integers into the
725 fields of a cons cell. See above caveats. */
726#define XSETCARFASTINT(c,n) XSETFASTINT(XCAR_AS_LVALUE(c),(n))
727#define XSETCDRFASTINT(c,n) XSETFASTINT(XCDR_AS_LVALUE(c),(n))
728
729/* Take the car or cdr of something whose type is not known. */ 724/* Take the car or cdr of something whose type is not known. */
730#define CAR(c) \ 725#define CAR(c) \
731 (CONSP ((c)) ? XCAR ((c)) \ 726 (CONSP ((c)) ? XCAR ((c)) \
@@ -2821,7 +2816,9 @@ extern Lisp_Object intern_c_string (const char *);
2821extern Lisp_Object make_symbol P_ ((char *)); 2816extern Lisp_Object make_symbol P_ ((char *));
2822extern Lisp_Object oblookup P_ ((Lisp_Object, const char *, int, int)); 2817extern Lisp_Object oblookup P_ ((Lisp_Object, const char *, int, int));
2823#define LOADHIST_ATTACH(x) \ 2818#define LOADHIST_ATTACH(x) \
2824 if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list) 2819 do { \
2820 if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list); \
2821 } while (0)
2825extern Lisp_Object Vcurrent_load_list; 2822extern Lisp_Object Vcurrent_load_list;
2826extern Lisp_Object Vload_history, Vload_suffixes, Vload_file_rep_suffixes; 2823extern Lisp_Object Vload_history, Vload_suffixes, Vload_file_rep_suffixes;
2827extern int openp P_ ((Lisp_Object, Lisp_Object, Lisp_Object, 2824extern int openp P_ ((Lisp_Object, Lisp_Object, Lisp_Object,