emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 9e977c4: Restore check for Emacs 20.2 bytecodes


From: Paul Eggert
Subject: master 9e977c4: Restore check for Emacs 20.2 bytecodes
Date: Sat, 23 May 2020 13:39:50 -0400 (EDT)

branch: master
commit 9e977c497257ff13bfb2579f8a14ca9b43791115
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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
---
 src/eval.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/eval.c b/src/eval.c
index be2af2d..959adea 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));
        }
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]