aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/src/lread.c b/src/lread.c
index 8b614e6220e..983fdb883ff 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3523,25 +3523,32 @@ bytecode_from_rev_list (Lisp_Object elems, Lisp_Object readcharfun)
3523 } 3523 }
3524 } 3524 }
3525 3525
3526 if (!(size >= CLOSURE_STACK_DEPTH + 1 && size <= CLOSURE_INTERACTIVE + 1 3526 if (!(size >= CLOSURE_STACK_DEPTH && size <= CLOSURE_INTERACTIVE + 1
3527 && (FIXNUMP (vec[CLOSURE_ARGLIST]) 3527 && (FIXNUMP (vec[CLOSURE_ARGLIST])
3528 || CONSP (vec[CLOSURE_ARGLIST]) 3528 || CONSP (vec[CLOSURE_ARGLIST])
3529 || NILP (vec[CLOSURE_ARGLIST])) 3529 || NILP (vec[CLOSURE_ARGLIST]))
3530 && STRINGP (vec[CLOSURE_CODE]) 3530 && ((STRINGP (vec[CLOSURE_CODE]) /* Byte-code function. */
3531 && VECTORP (vec[CLOSURE_CONSTANTS]) 3531 && VECTORP (vec[CLOSURE_CONSTANTS])
3532 && FIXNATP (vec[CLOSURE_STACK_DEPTH]))) 3532 && size > CLOSURE_STACK_DEPTH
3533 && (FIXNATP (vec[CLOSURE_STACK_DEPTH])))
3534 || (CONSP (vec[CLOSURE_CODE]) /* Interpreted function. */
3535 && (CONSP (vec[CLOSURE_CONSTANTS])
3536 || NILP (vec[CLOSURE_CONSTANTS]))))))
3533 invalid_syntax ("Invalid byte-code object", readcharfun); 3537 invalid_syntax ("Invalid byte-code object", readcharfun);
3534 3538
3535 if (STRING_MULTIBYTE (vec[CLOSURE_CODE])) 3539 if (STRINGP (vec[CLOSURE_CODE]))
3536 /* BYTESTR must have been produced by Emacs 20.2 or earlier 3540 {
3537 because it produced a raw 8-bit string for byte-code and 3541 if (STRING_MULTIBYTE (vec[CLOSURE_CODE]))
3538 now such a byte-code string is loaded as multibyte with 3542 /* BYTESTR must have been produced by Emacs 20.2 or earlier
3539 raw 8-bit characters converted to multibyte form. 3543 because it produced a raw 8-bit string for byte-code and
3540 Convert them back to the original unibyte form. */ 3544 now such a byte-code string is loaded as multibyte with
3541 vec[CLOSURE_CODE] = Fstring_as_unibyte (vec[CLOSURE_CODE]); 3545 raw 8-bit characters converted to multibyte form.
3542 3546 Convert them back to the original unibyte form. */
3543 /* Bytecode must be immovable. */ 3547 vec[CLOSURE_CODE] = Fstring_as_unibyte (vec[CLOSURE_CODE]);
3544 pin_string (vec[CLOSURE_CODE]); 3548
3549 /* Bytecode must be immovable. */
3550 pin_string (vec[CLOSURE_CODE]);
3551 }
3545 3552
3546 XSETPVECTYPE (XVECTOR (obj), PVEC_CLOSURE); 3553 XSETPVECTYPE (XVECTOR (obj), PVEC_CLOSURE);
3547 return obj; 3554 return obj;