# HG changeset patch # User Kenichi Handa # Date 958780252 0 # Node ID 4c808e415352d34a31eba6971f004d362aa2636d # Parent d8c9e2f7022fe11d72f08a9868b97d2e71c3e0ee (Fbyte_code): If arg BYTESTR is multibyte, convert it to unibyte. diff -r d8c9e2f7022f -r 4c808e415352 src/bytecode.c --- a/src/bytecode.c Fri May 19 23:50:26 2000 +0000 +++ b/src/bytecode.c Fri May 19 23:50:52 2000 +0000 @@ -401,12 +401,12 @@ #endif int op; /* Lisp_Object v1, v2; */ - Lisp_Object *vectorp = XVECTOR (vector)->contents; + Lisp_Object *vectorp; #ifdef BYTE_CODE_SAFE int const_length = XVECTOR (vector)->size; Lisp_Object *stacke; #endif - int bytestr_length = STRING_BYTES (XSTRING (bytestr)); + int bytestr_length; struct byte_stack stack; Lisp_Object *top; Lisp_Object result; @@ -416,6 +416,17 @@ vector = wrong_type_argument (Qvectorp, vector); CHECK_NUMBER (maxdepth, 2); + if (STRING_MULTIBYTE (bytestr)) + /* BYTESTR must have been produced by Emacs 20.2 or the earlier + because they produced a raw 8-bit string for byte-code and now + such a byte-code string is loaded as multibyte while raw 8-bit + characters converted to multibyte form. Thus, now we must + convert them back to the original unibyte form. */ + bytestr = Fstring_as_unibyte (bytestr); + + bytestr_length = STRING_BYTES (XSTRING (bytestr)); + vectorp = XVECTOR (vector)->contents; + stack.byte_string = bytestr; stack.pc = stack.byte_string_start = XSTRING (bytestr)->data; stack.constants = vector;