From: Paul Eggert Date: Sat, 23 May 2020 17:38:53 +0000 (-0700) Subject: Restore check for Emacs 20.2 bytecodes X-Git-Tag: emacs-28.0.90~7290 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9e977c497257ff13bfb2579f8a14ca9b43791115;p=emacs.git 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 --- 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)); } }