Mercurial > hg > xemacs-beta
diff src/lread.c @ 4608:1e3cf11fa27d
Make #$ truly read-only for Lisp; check this in the test suite.
lisp/ChangeLog addition:
2009-02-10 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el :
Check that #$ is not modifiable from Lisp, and that load-file-name
is modifiable from Lisp.
src/ChangeLog addition:
2009-02-10 Aidan Kehoe <kehoea@parhasard.net>
* lread.c (Fload_internal):
Make load-file-name-internal readonly for Lisp code; make
load-file-name a modifiable copy.
(init_lread):
Initialised Vload_file_name_internal, Vload_file_name to nil on
each post-dump start.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 10 Feb 2009 16:07:31 +0000 |
parents | 7869173584fc |
children | 8f1ee2d15784 |
line wrap: on
line diff
--- a/src/lread.c Sun Feb 08 18:45:22 2009 +0000 +++ b/src/lread.c Tue Feb 10 16:07:31 2009 +0000 @@ -711,6 +711,8 @@ PRINT_LOADING_MESSAGE (""); + LISP_READONLY (found) = 1; + { /* Lisp_Object's must be malloc'ed, not stack-allocated */ Lisp_Object lispstream = Qnil; @@ -738,7 +740,8 @@ record_unwind_protect (load_force_doc_string_unwind, Vload_force_doc_string_list); Vload_force_doc_string_list = Qnil; - internal_bind_lisp_object (&Vload_file_name, found); + /* load-file-name is not read-only to Lisp. */ + internal_bind_lisp_object (&Vload_file_name, Fcopy_sequence(found)); #ifdef I18N3 /* set it to nil; a call to #'domain will set it. */ internal_bind_lisp_object (&Vfile_domain, Qnil); @@ -3266,6 +3269,9 @@ Vread_buffer_stream = make_resizing_buffer_output_stream (); Vload_force_doc_string_list = Qnil; + + Vload_file_name_internal = Qnil; + Vload_file_name = Qnil; } void