diff options
author | Kenichi Handa <handa@m17n.org> | 2000-05-19 23:50:52 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2000-05-19 23:50:52 +0000 |
commit | 089b985ff9f2d34e99b4c62c928c461ffc0bf2a9 (patch) | |
tree | aa430cd1b917e58107689a0449303ee31552cca2 /src/bytecode.c | |
parent | a9bcded1f3d845d5dd65a52d749477ecf5aa3f93 (diff) | |
download | emacs-089b985ff9f2d34e99b4c62c928c461ffc0bf2a9.tar.gz |
(Fbyte_code): If arg BYTESTR is multibyte, convert it
to unibyte.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r-- | src/bytecode.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/bytecode.c b/src/bytecode.c index ff9a36e54b7..bfbb3b847e0 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -401,12 +401,12 @@ If the third argument is incorrect, Emacs may crash.") #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 @@ If the third argument is incorrect, Emacs may crash.") 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; |