diff options
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/lread.c b/src/lread.c index 5f3871436df..4c6b7673228 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -3846,23 +3846,17 @@ string_to_number (char const *string, int base, ptrdiff_t *plen) | |||
| 3846 | static Lisp_Object | 3846 | static Lisp_Object |
| 3847 | read_vector (Lisp_Object readcharfun, bool bytecodeflag) | 3847 | read_vector (Lisp_Object readcharfun, bool bytecodeflag) |
| 3848 | { | 3848 | { |
| 3849 | ptrdiff_t i, size; | 3849 | Lisp_Object tem = read_list (1, readcharfun); |
| 3850 | Lisp_Object *ptr; | 3850 | Lisp_Object len = Flength (tem); |
| 3851 | Lisp_Object tem, item, vector; | 3851 | ptrdiff_t size = XFIXNAT (len); |
| 3852 | struct Lisp_Cons *otem; | 3852 | if (bytecodeflag && size <= COMPILED_STACK_DEPTH) |
| 3853 | Lisp_Object len; | ||
| 3854 | |||
| 3855 | tem = read_list (1, readcharfun); | ||
| 3856 | len = Flength (tem); | ||
| 3857 | if (bytecodeflag && XFIXNAT (len) <= COMPILED_STACK_DEPTH) | ||
| 3858 | error ("Invalid byte code"); | 3853 | error ("Invalid byte code"); |
| 3859 | vector = Fmake_vector (len, Qnil); | 3854 | Lisp_Object vector = make_nil_vector (size); |
| 3860 | 3855 | ||
| 3861 | size = XFIXNAT (len); | 3856 | Lisp_Object *ptr = XVECTOR (vector)->contents; |
| 3862 | ptr = XVECTOR (vector)->contents; | 3857 | for (ptrdiff_t i = 0; i < size; i++) |
| 3863 | for (i = 0; i < size; i++) | ||
| 3864 | { | 3858 | { |
| 3865 | item = Fcar (tem); | 3859 | Lisp_Object item = Fcar (tem); |
| 3866 | /* If `load-force-doc-strings' is t when reading a lazily-loaded | 3860 | /* If `load-force-doc-strings' is t when reading a lazily-loaded |
| 3867 | bytecode object, the docstring containing the bytecode and | 3861 | bytecode object, the docstring containing the bytecode and |
| 3868 | constants values must be treated as unibyte and passed to | 3862 | constants values must be treated as unibyte and passed to |
| @@ -3896,7 +3890,7 @@ read_vector (Lisp_Object readcharfun, bool bytecodeflag) | |||
| 3896 | if (!CONSP (item)) | 3890 | if (!CONSP (item)) |
| 3897 | error ("Invalid byte code"); | 3891 | error ("Invalid byte code"); |
| 3898 | 3892 | ||
| 3899 | otem = XCONS (item); | 3893 | struct Lisp_Cons *otem = XCONS (item); |
| 3900 | bytestr = XCAR (item); | 3894 | bytestr = XCAR (item); |
| 3901 | item = XCDR (item); | 3895 | item = XCDR (item); |
| 3902 | free_cons (otem); | 3896 | free_cons (otem); |
| @@ -3916,7 +3910,7 @@ read_vector (Lisp_Object readcharfun, bool bytecodeflag) | |||
| 3916 | } | 3910 | } |
| 3917 | } | 3911 | } |
| 3918 | ASET (vector, i, item); | 3912 | ASET (vector, i, item); |
| 3919 | otem = XCONS (tem); | 3913 | struct Lisp_Cons *otem = XCONS (tem); |
| 3920 | tem = Fcdr (tem); | 3914 | tem = Fcdr (tem); |
| 3921 | free_cons (otem); | 3915 | free_cons (otem); |
| 3922 | } | 3916 | } |
| @@ -4383,7 +4377,7 @@ OBARRAY defaults to the value of `obarray'. */) | |||
| 4383 | void | 4377 | void |
| 4384 | init_obarray (void) | 4378 | init_obarray (void) |
| 4385 | { | 4379 | { |
| 4386 | Vobarray = Fmake_vector (make_fixnum (OBARRAY_SIZE), make_fixnum (0)); | 4380 | Vobarray = make_vector (OBARRAY_SIZE, make_fixnum (0)); |
| 4387 | initial_obarray = Vobarray; | 4381 | initial_obarray = Vobarray; |
| 4388 | staticpro (&initial_obarray); | 4382 | staticpro (&initial_obarray); |
| 4389 | 4383 | ||