Avoid assertion violations in STRING_CHAR
* src/xdisp.c (handle_composition_prop):
* src/editfns.c (styled_format): Don't call 'STRING_CHAR' on
unibyte strings. This avoids assertion violation in
'string_char_and_length'.
(cherry picked from commit d52d6e1e10
)
This commit is contained in:
parent
78c262e1c2
commit
b560ce3560
2 changed files with 7 additions and 2 deletions
|
@ -3468,7 +3468,9 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|
|||
|| conversion == 'o' || conversion == 'x'
|
||||
|| conversion == 'X'))
|
||||
error ("Invalid format operation %%%c",
|
||||
STRING_CHAR ((unsigned char *) format - 1));
|
||||
multibyte_format
|
||||
? STRING_CHAR ((unsigned char *) format - 1)
|
||||
: *((unsigned char *) format - 1));
|
||||
else if (! (FIXNUMP (arg) || ((BIGNUMP (arg) || FLOATP (arg))
|
||||
&& conversion != 'c')))
|
||||
error ("Format specifier doesn't match argument type");
|
||||
|
|
|
@ -6034,7 +6034,10 @@ handle_composition_prop (struct it *it)
|
|||
pos_byte = IT_STRING_BYTEPOS (*it);
|
||||
string = it->string;
|
||||
s = SDATA (string) + pos_byte;
|
||||
it->c = STRING_CHAR (s);
|
||||
if (STRING_MULTIBYTE (string))
|
||||
it->c = STRING_CHAR (s);
|
||||
else
|
||||
it->c = *s;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue