Mercurial > emacs
comparison src/bytecode.c @ 28999:4c808e415352
(Fbyte_code): If arg BYTESTR is multibyte, convert it
to unibyte.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 19 May 2000 23:50:52 +0000 |
parents | 334ebb7a551c |
children | d0b424336374 |
comparison
equal
deleted
inserted
replaced
28998:d8c9e2f7022f | 28999:4c808e415352 |
---|---|
399 int this_op = 0; | 399 int this_op = 0; |
400 int prev_op; | 400 int prev_op; |
401 #endif | 401 #endif |
402 int op; | 402 int op; |
403 /* Lisp_Object v1, v2; */ | 403 /* Lisp_Object v1, v2; */ |
404 Lisp_Object *vectorp = XVECTOR (vector)->contents; | 404 Lisp_Object *vectorp; |
405 #ifdef BYTE_CODE_SAFE | 405 #ifdef BYTE_CODE_SAFE |
406 int const_length = XVECTOR (vector)->size; | 406 int const_length = XVECTOR (vector)->size; |
407 Lisp_Object *stacke; | 407 Lisp_Object *stacke; |
408 #endif | 408 #endif |
409 int bytestr_length = STRING_BYTES (XSTRING (bytestr)); | 409 int bytestr_length; |
410 struct byte_stack stack; | 410 struct byte_stack stack; |
411 Lisp_Object *top; | 411 Lisp_Object *top; |
412 Lisp_Object result; | 412 Lisp_Object result; |
413 | 413 |
414 CHECK_STRING (bytestr, 0); | 414 CHECK_STRING (bytestr, 0); |
415 if (!VECTORP (vector)) | 415 if (!VECTORP (vector)) |
416 vector = wrong_type_argument (Qvectorp, vector); | 416 vector = wrong_type_argument (Qvectorp, vector); |
417 CHECK_NUMBER (maxdepth, 2); | 417 CHECK_NUMBER (maxdepth, 2); |
418 | |
419 if (STRING_MULTIBYTE (bytestr)) | |
420 /* BYTESTR must have been produced by Emacs 20.2 or the earlier | |
421 because they produced a raw 8-bit string for byte-code and now | |
422 such a byte-code string is loaded as multibyte while raw 8-bit | |
423 characters converted to multibyte form. Thus, now we must | |
424 convert them back to the original unibyte form. */ | |
425 bytestr = Fstring_as_unibyte (bytestr); | |
426 | |
427 bytestr_length = STRING_BYTES (XSTRING (bytestr)); | |
428 vectorp = XVECTOR (vector)->contents; | |
418 | 429 |
419 stack.byte_string = bytestr; | 430 stack.byte_string = bytestr; |
420 stack.pc = stack.byte_string_start = XSTRING (bytestr)->data; | 431 stack.pc = stack.byte_string_start = XSTRING (bytestr)->data; |
421 stack.constants = vector; | 432 stack.constants = vector; |
422 stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth) | 433 stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth) |