unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problem report #124: base/src/emacs/src/term.c (encode_terminal_code); UNINIT
@ 2008-12-03  1:01 Dan Nicolaescu
  2008-12-03 15:35 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Nicolaescu @ 2008-12-03  1:01 UTC (permalink / raw)
  To: emacs-devel

CID: 124
Checker: UNINIT (help)
File: base/src/emacs/src/term.c
Function: encode_terminal_code
Description: Using uninitialized value "c" in call to function
"char_charset"

Event var_decl: Declared variable "c" without initializer
Also see events: [uninit_use_in_call]

655  		  int c;
656  		  Lisp_Object string;
657  	
658  		  string = Qnil;

At conditional (1): "(((src + 0))->u).ch < 256" taking true path
At conditional (2): "0" taking false path

659  		  SET_GLYPH_FROM_CHAR_GLYPH (g, src[0]);
660  	

At conditional (3): "(g).ch < 0" taking false path
At conditional (4): "(g).face_id != 0" taking false path
At conditional (5): "(g).ch >= tlen" taking false path
At conditional (6): "*(tbase + ((g).ch * 8)) & 7 != 3" taking false path

661  		  if (GLYPH_INVALID_P (g) || GLYPH_SIMPLE_P (tbase, tlen, g))
662  		    {
663  		      /* This glyph doesn't have an entry in Vglyph_table.  */
664  		      c = src->u.ch;
665  		    }
666  		  else
667  		    {
668  		      /* This glyph has an entry in Vglyph_table,
669  			 so process any alias before testing for simpleness.  */

At conditional (7): "(g).face_id == 0" taking true path
At conditional (8): "(g).ch < tlen" taking true path
At conditional (9): "*(tbase + ((g).ch * 8)) & 7 == 0" taking true path
At conditional (10): "(g).face_id == 0" taking true path
At conditional (11): "(g).ch < tlen" taking true path
At conditional (12): "*(tbase + ((g).ch * 8)) & 7 == 0" taking false path
At conditional (13): "(g).ch > 4194303" taking true path
At conditional (14): "0" taking false path

670  		      GLYPH_FOLLOW_ALIASES (tbase, tlen, g);
671  	

At conditional (15): "(g).face_id != 0" taking false path
At conditional (16): "(g).ch >= tlen" taking false path
At conditional (17): "*(tbase + ((g).ch * 8)) & 7 != 3" taking false path

672  		      if (GLYPH_SIMPLE_P (tbase, tlen, g))
673  			/* We set the multi-byte form of a character in G
674  			   (that should be an ASCII character) at WORKBUF.  */
675  			c = GLYPH_CHAR (g);
676  		      else
677  			/* We have a string in Vglyph_table.  */
678  			string = tbase[GLYPH_CHAR (g)];
679  		    }
680  	

At conditional (18): "string == Qnil" taking true path

681  		  if (NILP (string))
682  		    {
683  		      nbytes = buf - encode_terminal_src;

At conditional (19): "encode_terminal_src_size < (nbytes + 5)" taking true path

684  		      if (encode_terminal_src_size < nbytes + MAX_MULTIBYTE_LENGTH)
685  			{
686  			  encode_terminal_src_size = nbytes + MAX_MULTIBYTE_LENGTH;
687  			  encode_terminal_src = xrealloc (encode_terminal_src,
688  							  encode_terminal_src_size);
689  			  buf = encode_terminal_src + nbytes;
690  			}

Event uninit_use_in_call: Using uninitialized value "c" in call to function "char_charset" [model]
Also see events: [var_decl]

691  		      if (char_charset (c, charset_list, NULL))
692  			{
693  			  /* Store the multibyte form of C at BUF.  */
694  			  buf += CHAR_STRING (c, buf);
695  			  nchars++;
696  			}
697  		      else
698  			{
699  			  /* C is not encodable.  */
700  			  *buf++ = '?';
701  			  nchars++;
702  			  while (src + 1 < src_end && CHAR_GLYPH_PADDING_P (src[1]))
703  			    {
704  			      *buf++ = '?';
705  			      nchars++;
706  			      src++;
707  			    }
708  			}
7




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Problem report #124: base/src/emacs/src/term.c (encode_terminal_code); UNINIT
  2008-12-03  1:01 Problem report #124: base/src/emacs/src/term.c (encode_terminal_code); UNINIT Dan Nicolaescu
@ 2008-12-03 15:35 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2008-12-03 15:35 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:

> CID: 124
> Checker: UNINIT (help)
> File: base/src/emacs/src/term.c
> Function: encode_terminal_code
> Description: Using uninitialized value "c" in call to function
> "char_charset"

Bogus, because "c" is assigned iff "string" is nil.  I guess the
Coverity scanner doesn't track paired variables of this sort.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-03 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-03  1:01 Problem report #124: base/src/emacs/src/term.c (encode_terminal_code); UNINIT Dan Nicolaescu
2008-12-03 15:35 ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).