unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problem report #121: base/src/emacs/src/coding.c (decode_coding_charset); UNINIT
@ 2008-12-03  0:59 Dan Nicolaescu
  2008-12-03  5:50 ` Kenichi Handa
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Nicolaescu @ 2008-12-03  0:59 UTC (permalink / raw)
  To: emacs-devel

CID: 121
Checker: UNINIT (help)
File: base/src/emacs/src/coding.c
Function: decode_coding_charset
Description: Using uninitialized value "charset"

Event var_decl: Declared variable "charset" without initializer
Also see events: [uninit_use]

5085 	      struct charset *charset;
5086 	      int dim;
5087 	      int len = 1;
5088 	      unsigned code;
5089 	
5090 	      src_base = src;
5091 	      consumed_chars_base = consumed_chars;
5092 	

At conditional (1): "charbuf >= charbuf_end" taking false path

5093 	      if (charbuf >= charbuf_end)
5094 		break;
5095 	

At conditional (2): "byte_after_cr >= 0" taking false path

5096 	      if (byte_after_cr >= 0)
5097 		{
5098 		  c = byte_after_cr;
5099 		  byte_after_cr = -1;
5100 		}
5101 	      else
5102 		{

At conditional (3): "src == src_end" taking false path
At conditional (4): "multibytep != 0" taking true path
At conditional (5): "c & 128 != 0" taking true path
At conditional (6): "c & 254 == 192" taking true path
At conditional (7): "0" taking false path

5103 		  ONE_MORE_BYTE (c);

At conditional (8): "eol_crlf != 0" taking true path
At conditional (9): "c == 13" taking false path

5104 		  if (eol_crlf && c == '\r')
5105 		    ONE_MORE_BYTE (byte_after_cr);
5106 		}

At conditional (10): "c < 0" taking false path

5107 	      if (c < 0)
5108 		goto invalid_code;
5109 	      code = c;
5110 	
5111 	      val = AREF (valids, c);

At conditional (11): "val == Qnil" taking false path

5112 	      if (NILP (val))
5113 		goto invalid_code;

At conditional (12): "val & 7 == 0" taking false path

5114 	      if (INTEGERP (val))
5115 		{
5116 		  charset = CHARSET_FROM_ID (XFASTINT (val));
5117 		  dim = CHARSET_DIMENSION (charset);
5118 		  while (len < dim)
5119 		    {
5120 		      ONE_MORE_BYTE (c);
5121 		      code = (code << 8) | c;
5122 		      len++;
5123 		    }
5124 		  CODING_DECODE_CHAR (coding, src, src_base, src_end,
5125 				      charset, code, c);
5126 		}
5127 	      else
5128 		{
5129 		  /* VAL is a list of charset IDs.  It is assured that the
5130 		     list is sorted by charset dimensions (smaller one
5131 		     comes first).  */

At conditional (13): "val & 7 == 5" taking false path

5132 		  while (CONSP (val))
5133 		    {
5134 		      charset = CHARSET_FROM_ID (XFASTINT (XCAR (val)));
5135 		      dim = CHARSET_DIMENSION (charset);
5136 		      while (len < dim)
5137 			{
5138 			  ONE_MORE_BYTE (c);
5139 			  code = (code << 8) | c;
5140 			  len++;
5141 			}
5142 		      CODING_DECODE_CHAR (coding, src, src_base,
5143 					  src_end, charset, code, c);
5144 		      if (c >= 0)
5145 			break;
5146 		      val = XCDR (val);
5147 		    }
5148 		}

At conditional (14): "c < 0" taking false path

5149 	      if (c < 0)
5150 		goto invalid_code;

Event uninit_use: Using uninitialized value "charset"
Also see events: [var_decl]

5151 	      if (charset->id != charset_ascii
5152 		  && last_id != charset->id)
5153 		{
5154 		  if (last_id != charset_ascii)
5155 		    ADD_CHARSET_DATA (charbuf, char_offset - last_offset, last_id);
5156 		  last_id = charset->id;
5157 		  last_offset = char_offset;
5158 		}
51




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

* Re: Problem report #121: base/src/emacs/src/coding.c (decode_coding_charset); UNINIT
  2008-12-03  0:59 Problem report #121: base/src/emacs/src/coding.c (decode_coding_charset); UNINIT Dan Nicolaescu
@ 2008-12-03  5:50 ` Kenichi Handa
  0 siblings, 0 replies; 2+ messages in thread
From: Kenichi Handa @ 2008-12-03  5:50 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

In article <200812030120.mB31KE60022803@mothra.ics.uci.edu>, Dan Nicolaescu <dann@ics.uci.edu> writes:

> CID: 121
> Checker: UNINIT (help)
> File: base/src/emacs/src/coding.c
> Function: decode_coding_charset
> Description: Using uninitialized value "charset"

It is assured that `charset' is always set because elements
of `valid' is nil, integer, or cons.  I installed a change
that just makes it clearer.

---
Kenichi Handa
handa@ni.aist.go.jp




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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-03  0:59 Problem report #121: base/src/emacs/src/coding.c (decode_coding_charset); UNINIT Dan Nicolaescu
2008-12-03  5:50 ` Kenichi Handa

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).