diff options
| author | Dmitry Antipov | 2014-10-02 18:01:27 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-10-02 18:01:27 +0400 |
| commit | 8eb61e5261cebf6a566b1138562953350080156b (patch) | |
| tree | e7581e3b7ee726e36f50568aa280c9107e64261b /src | |
| parent | 1c1425565ddbb555c5943690d435264d57454c81 (diff) | |
| download | emacs-8eb61e5261cebf6a566b1138562953350080156b.tar.gz emacs-8eb61e5261cebf6a566b1138562953350080156b.zip | |
* alloc.c (mark_overlay): Assume that overlay boundaries are
always markers. Add comment.
* lread.c (read_internal_start): Use convenient validate_subarray.
Adjust docstring.
(Fread_from_string): Adjust docstring.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/alloc.c | 5 | ||||
| -rw-r--r-- | src/lread.c | 30 |
3 files changed, 18 insertions, 25 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f3c881f630d..2a4ce099021 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-10-02 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * alloc.c (mark_overlay): Assume that overlay boundaries are | ||
| 4 | always markers. Add comment. | ||
| 5 | * lread.c (read_internal_start): Use convenient validate_subarray. | ||
| 6 | Adjust docstring. | ||
| 7 | (Fread_from_string): Adjust docstring. | ||
| 8 | |||
| 1 | 2014-10-02 Stefan Monnier <monnier@iro.umontreal.ca> | 9 | 2014-10-02 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 10 | ||
| 3 | * lisp.h: Fix up compilation for USE_STACK_LISP_OBJECTS=false. | 11 | * lisp.h: Fix up compilation for USE_STACK_LISP_OBJECTS=false. |
diff --git a/src/alloc.c b/src/alloc.c index f656dc94216..faad0b59c87 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -6015,8 +6015,9 @@ mark_overlay (struct Lisp_Overlay *ptr) | |||
| 6015 | for (; ptr && !ptr->gcmarkbit; ptr = ptr->next) | 6015 | for (; ptr && !ptr->gcmarkbit; ptr = ptr->next) |
| 6016 | { | 6016 | { |
| 6017 | ptr->gcmarkbit = 1; | 6017 | ptr->gcmarkbit = 1; |
| 6018 | mark_object (ptr->start); | 6018 | /* These two are always markers and can be marked fast. */ |
| 6019 | mark_object (ptr->end); | 6019 | XMARKER (ptr->start)->gcmarkbit = 1; |
| 6020 | XMARKER (ptr->end)->gcmarkbit = 1; | ||
| 6020 | mark_object (ptr->plist); | 6021 | mark_object (ptr->plist); |
| 6021 | } | 6022 | } |
| 6022 | } | 6023 | } |
diff --git a/src/lread.c b/src/lread.c index 0e71b13c5c8..59af12cf6da 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -2096,9 +2096,10 @@ DEFUN ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0, | |||
| 2096 | doc: /* Read one Lisp expression which is represented as text by STRING. | 2096 | doc: /* Read one Lisp expression which is represented as text by STRING. |
| 2097 | Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX). | 2097 | Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX). |
| 2098 | FINAL-STRING-INDEX is an integer giving the position of the next | 2098 | FINAL-STRING-INDEX is an integer giving the position of the next |
| 2099 | remaining character in STRING. | 2099 | remaining character in STRING. START and END optionally delimit |
| 2100 | START and END optionally delimit a substring of STRING from which to read; | 2100 | a substring of STRING from which to read; they default to 0 and |
| 2101 | they default to 0 and (length STRING) respectively. */) | 2101 | (length STRING) respectively. Negative values are counted from |
| 2102 | the end of STRING. */) | ||
| 2102 | (Lisp_Object string, Lisp_Object start, Lisp_Object end) | 2103 | (Lisp_Object string, Lisp_Object start, Lisp_Object end) |
| 2103 | { | 2104 | { |
| 2104 | Lisp_Object ret; | 2105 | Lisp_Object ret; |
| @@ -2109,10 +2110,9 @@ START and END optionally delimit a substring of STRING from which to read; | |||
| 2109 | } | 2110 | } |
| 2110 | 2111 | ||
| 2111 | /* Function to set up the global context we need in toplevel read | 2112 | /* Function to set up the global context we need in toplevel read |
| 2112 | calls. */ | 2113 | calls. START and END only used when STREAM is a string. */ |
| 2113 | static Lisp_Object | 2114 | static Lisp_Object |
| 2114 | read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end) | 2115 | read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end) |
| 2115 | /* `start', `end' only used when stream is a string. */ | ||
| 2116 | { | 2116 | { |
| 2117 | Lisp_Object retval; | 2117 | Lisp_Object retval; |
| 2118 | 2118 | ||
| @@ -2134,25 +2134,9 @@ read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end) | |||
| 2134 | else | 2134 | else |
| 2135 | string = XCAR (stream); | 2135 | string = XCAR (stream); |
| 2136 | 2136 | ||
| 2137 | if (NILP (end)) | 2137 | validate_subarray (string, start, end, SCHARS (string), |
| 2138 | endval = SCHARS (string); | 2138 | &startval, &endval); |
| 2139 | else | ||
| 2140 | { | ||
| 2141 | CHECK_NUMBER (end); | ||
| 2142 | if (! (0 <= XINT (end) && XINT (end) <= SCHARS (string))) | ||
| 2143 | args_out_of_range (string, end); | ||
| 2144 | endval = XINT (end); | ||
| 2145 | } | ||
| 2146 | 2139 | ||
| 2147 | if (NILP (start)) | ||
| 2148 | startval = 0; | ||
| 2149 | else | ||
| 2150 | { | ||
| 2151 | CHECK_NUMBER (start); | ||
| 2152 | if (! (0 <= XINT (start) && XINT (start) <= endval)) | ||
| 2153 | args_out_of_range (string, start); | ||
| 2154 | startval = XINT (start); | ||
| 2155 | } | ||
| 2156 | read_from_string_index = startval; | 2140 | read_from_string_index = startval; |
| 2157 | read_from_string_index_byte = string_char_to_byte (string, startval); | 2141 | read_from_string_index_byte = string_char_to_byte (string, startval); |
| 2158 | read_from_string_limit = endval; | 2142 | read_from_string_limit = endval; |