diff options
| author | Andrea Corallo | 2020-05-24 10:20:23 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-05-24 10:20:23 +0100 |
| commit | 9daffe9cfe82d3b1e1e9fa8929dbb40cfed60f0f (patch) | |
| tree | c9e78cbb4e151dc3c3996a65cf1eedab19248fb4 /src/lread.c | |
| parent | f5dceed09a8234548d5b3acb76d443569533cab9 (diff) | |
| parent | e021c2dc2279e0fd3a5331f9ea661e4d39c2e840 (diff) | |
| download | emacs-9daffe9cfe82d3b1e1e9fa8929dbb40cfed60f0f.tar.gz emacs-9daffe9cfe82d3b1e1e9fa8929dbb40cfed60f0f.zip | |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/lread.c b/src/lread.c index 01f359ca581..46725d9b0ff 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -3030,8 +3030,26 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 3030 | struct Lisp_Vector *vec; | 3030 | struct Lisp_Vector *vec; |
| 3031 | tmp = read_vector (readcharfun, 1); | 3031 | tmp = read_vector (readcharfun, 1); |
| 3032 | vec = XVECTOR (tmp); | 3032 | vec = XVECTOR (tmp); |
| 3033 | if (vec->header.size == 0) | 3033 | if (! (COMPILED_STACK_DEPTH < vec->header.size |
| 3034 | invalid_syntax ("Empty byte-code object"); | 3034 | && (FIXNUMP (vec->contents[COMPILED_ARGLIST]) |
| 3035 | || CONSP (vec->contents[COMPILED_ARGLIST]) | ||
| 3036 | || NILP (vec->contents[COMPILED_ARGLIST])) | ||
| 3037 | && ((STRINGP (vec->contents[COMPILED_BYTECODE]) | ||
| 3038 | && VECTORP (vec->contents[COMPILED_CONSTANTS])) | ||
| 3039 | || CONSP (vec->contents[COMPILED_BYTECODE])) | ||
| 3040 | && FIXNATP (vec->contents[COMPILED_STACK_DEPTH]))) | ||
| 3041 | invalid_syntax ("Invalid byte-code object"); | ||
| 3042 | |||
| 3043 | if (STRING_MULTIBYTE (AREF (tmp, COMPILED_BYTECODE))) | ||
| 3044 | { | ||
| 3045 | /* BYTESTR must have been produced by Emacs 20.2 or earlier | ||
| 3046 | because it produced a raw 8-bit string for byte-code and | ||
| 3047 | now such a byte-code string is loaded as multibyte with | ||
| 3048 | raw 8-bit characters converted to multibyte form. | ||
| 3049 | Convert them back to the original unibyte form. */ | ||
| 3050 | ASET (tmp, COMPILED_BYTECODE, | ||
| 3051 | Fstring_as_unibyte (AREF (tmp, COMPILED_BYTECODE))); | ||
| 3052 | } | ||
| 3035 | 3053 | ||
| 3036 | if (COMPILED_DOC_STRING < vec->header.size | 3054 | if (COMPILED_DOC_STRING < vec->header.size |
| 3037 | && EQ (AREF (tmp, COMPILED_DOC_STRING), make_fixnum (0))) | 3055 | && EQ (AREF (tmp, COMPILED_DOC_STRING), make_fixnum (0))) |
| @@ -3050,7 +3068,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 3050 | ASET (tmp, COMPILED_DOC_STRING, make_ufixnum (hash)); | 3068 | ASET (tmp, COMPILED_DOC_STRING, make_ufixnum (hash)); |
| 3051 | } | 3069 | } |
| 3052 | 3070 | ||
| 3053 | make_byte_code (vec); | 3071 | XSETPVECTYPE (vec, PVEC_COMPILED); |
| 3054 | return tmp; | 3072 | return tmp; |
| 3055 | } | 3073 | } |
| 3056 | if (c == '(') | 3074 | if (c == '(') |
| @@ -3888,8 +3906,6 @@ read_vector (Lisp_Object readcharfun, bool bytecodeflag) | |||
| 3888 | { | 3906 | { |
| 3889 | Lisp_Object tem = read_list (1, readcharfun); | 3907 | Lisp_Object tem = read_list (1, readcharfun); |
| 3890 | ptrdiff_t size = list_length (tem); | 3908 | ptrdiff_t size = list_length (tem); |
| 3891 | if (bytecodeflag && size <= COMPILED_STACK_DEPTH) | ||
| 3892 | error ("Invalid byte code"); | ||
| 3893 | Lisp_Object vector = make_nil_vector (size); | 3909 | Lisp_Object vector = make_nil_vector (size); |
| 3894 | 3910 | ||
| 3895 | Lisp_Object *ptr = XVECTOR (vector)->contents; | 3911 | Lisp_Object *ptr = XVECTOR (vector)->contents; |