diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-05-23 10:38:53 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-05-23 10:39:45 -0700 |
commit | 9e977c497257ff13bfb2579f8a14ca9b43791115 (patch) | |
tree | 4c80b4cf0d82c6f86a34961d0a60434d71a4ac05 /src/eval.c | |
parent | d436e4840a2a99e9717497a7d7dc7a36dbd0ecc9 (diff) | |
download | emacs-9e977c497257ff13bfb2579f8a14ca9b43791115.tar.gz |
Restore check for Emacs 20.2 bytecodes
* src/eval.c (Ffetch_bytecode): Check for multibyte bytecodes
here too. Problem reported by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2020-05/msg02876.html
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index be2af2d041b..959adea6467 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3202,7 +3202,19 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode, else error ("Invalid byte code"); } - ASET (object, COMPILED_BYTECODE, XCAR (tem)); + + Lisp_Object bytecode = XCAR (tem); + if (STRING_MULTIBYTE (bytecode)) + { + /* BYTECODE must have been produced by Emacs 20.2 or earlier + because it produced a raw 8-bit string for byte-code and now + such a byte-code string is loaded as multibyte with raw 8-bit + characters converted to multibyte form. Convert them back to + the original unibyte form. */ + bytecode = Fstring_as_unibyte (bytecode); + } + + ASET (object, COMPILED_BYTECODE, bytecode); ASET (object, COMPILED_CONSTANTS, XCDR (tem)); } } |