Remove encode_terminal_code UNINITs
* src/term.c (encode_terminal_code): Clarify by removing a couple of UNINITs and testing the local variable ‘cmp’ instead of retesting src->u.cmp.automatic. This pacifies gcc 11.2.1 -Wanalyzer-null-dereference.
This commit is contained in:
parent
2a00634880
commit
7e871dcd27
1 changed files with 4 additions and 3 deletions
|
@ -549,13 +549,14 @@ encode_terminal_code (struct glyph *src, int src_len,
|
|||
{
|
||||
if (src->type == COMPOSITE_GLYPH)
|
||||
{
|
||||
struct composition *cmp UNINIT;
|
||||
Lisp_Object gstring UNINIT;
|
||||
struct composition *cmp;
|
||||
Lisp_Object gstring;
|
||||
int i;
|
||||
|
||||
nbytes = buf - encode_terminal_src;
|
||||
if (src->u.cmp.automatic)
|
||||
{
|
||||
cmp = NULL;
|
||||
gstring = composition_gstring_from_id (src->u.cmp.id);
|
||||
required = src->slice.cmp.to - src->slice.cmp.from + 1;
|
||||
}
|
||||
|
@ -575,7 +576,7 @@ encode_terminal_code (struct glyph *src, int src_len,
|
|||
buf = encode_terminal_src + nbytes;
|
||||
}
|
||||
|
||||
if (src->u.cmp.automatic)
|
||||
if (!cmp)
|
||||
for (i = src->slice.cmp.from; i <= src->slice.cmp.to; i++)
|
||||
{
|
||||
Lisp_Object g = LGSTRING_GLYPH (gstring, i);
|
||||
|
|
Loading…
Add table
Reference in a new issue