* Problem report #113: base/src/emacs/src/coding.c (decode_coding_object); UNINIT
@ 2008-12-02 22:23 Dan Nicolaescu
2008-12-02 23:31 ` Davis Herring
0 siblings, 1 reply; 2+ messages in thread
From: Dan Nicolaescu @ 2008-12-02 22:23 UTC (permalink / raw)
To: emacs-devel
CID: 113
Checker: UNINIT (help)
File: base/src/emacs/src/coding.c
Function: decode_coding_object
Description: Using uninitialized value "saved_pt_byte" in call to function "temp_set_point_both"
Event var_decl: Declared variable "saved_pt_byte" without initializer
Also see events: [uninit_use][uninit_use][uninit_use_in_call]
7141 int saved_pt = -1, saved_pt_byte;
7142 int need_marker_adjustment = 0;
7143 Lisp_Object old_deactivate_mark;
7144
7145 old_deactivate_mark = Vdeactivate_mark;
7146
At conditional (1): "dst_object == Qnil" taking true path
7147 if (NILP (dst_object))
7148 {
7149 destination = coding->destination;
7150 dst_bytes = coding->dst_bytes;
7151 }
7152
7153 coding->src_object = src_object;
7154 coding->src_chars = chars;
7155 coding->src_bytes = bytes;
At conditional (2): "chars < bytes" taking true path
7156 coding->src_multibyte = chars < bytes;
7157
At conditional (3): "src_object & 7 == 3" taking false path
7158 if (STRINGP (src_object))
7159 {
7160 coding->src_pos = from;
7161 coding->src_pos_byte = from_byte;
7162 }
At conditional (4): "src_object & 7 == 4" taking true path
At conditional (5): "((0), (src_object & -8))->size & 4611686018427518976 == 4611686018427518976" taking true path
7163 else if (BUFFERP (src_object))
7164 {
7165 set_buffer_internal (XBUFFER (src_object));
At conditional (6): "from != ((current_buffer)->text)->gpt" taking true path
7166 if (from != GPT)
7167 move_gap_both (from, from_byte);
At conditional (7): "src_object == dst_object" taking false path
7168 if (EQ (src_object, dst_object))
7169 {
7170 struct Lisp_Marker *tail;
7171
7172 for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next)
7173 {
7174 tail->need_adjustment
7175 = tail->charpos == (tail->insertion_type ? from : to);
7176 need_marker_adjustment |= tail->need_adjustment;
7177 }
7178 saved_pt = PT, saved_pt_byte = PT_BYTE;
7179 TEMP_SET_PT_BOTH (from, from_byte);
7180 current_buffer->text->inhibit_shrinking = 1;
7181 del_range_both (from, from_byte, to, to_byte, 1);
7182 coding->src_pos = -chars;
7183 coding->src_pos_byte = -bytes;
7184 }
7185 else
7186 {
7187 coding->src_pos = from;
7188 coding->src_pos_byte = from_byte;
7189 }
7190 }
7191
At conditional (8): "(coding)->common_flags & 4096 != 0" taking true path
7192 if (CODING_REQUIRE_DETECTION (coding))
7193 detect_coding (coding);
7194 attrs = CODING_ID_ATTRS (coding->id);
7195
At conditional (9): "dst_object == Qt" taking true path
7196 if (EQ (dst_object, Qt)
7197 || (! NILP (CODING_ATTR_POST_READ (attrs))
7198 && NILP (dst_object)))
7199 {
At conditional (10): "(coding)->common_flags & 256 == 0" taking true path
7200 coding->dst_multibyte = !CODING_FOR_UNIBYTE (coding);
7201 coding->dst_object = code_conversion_save (1, coding->dst_multibyte);
7202 coding->dst_pos = BEG;
7203 coding->dst_pos_byte = BEG_BYTE;
7204 }
7205 else if (BUFFERP (dst_object))
7206 {
7207 code_conversion_save (0, 0);
7208 coding->dst_object = dst_object;
7209 coding->dst_pos = BUF_PT (XBUFFER (dst_object));
7210 coding->dst_pos_byte = BUF_PT_BYTE (XBUFFER (dst_object));
7211 coding->dst_multibyte
7212 = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters);
7213 }
7214 else
7215 {
7216 code_conversion_save (0, 0);
7217 coding->dst_object = Qnil;
7218 /* Most callers presume this will return a multibyte result, and they
7219 won't use `binary' or `raw-text' anyway, so let's not worry about
7220 CODING_FOR_UNIBYTE. */
7221 coding->dst_multibyte = 1;
7222 }
7223
7224 decode_coding (coding);
7225
At conditional (11): "(coding)->dst_object & 7 == 4" taking true path
At conditional (12): "((0), ((coding)->dst_object & -8))->size & 4611686018427518976 == 4611686018427518976" taking true path
7226 if (BUFFERP (coding->dst_object))
7227 set_buffer_internal (XBUFFER (coding->dst_object));
7228
At conditional (13): "((0), (attrs & -8))->contents[9] != Qnil" taking true path
7229 if (! NILP (CODING_ATTR_POST_READ (attrs)))
7230 {
7231 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
7232 EMACS_INT prev_Z = Z, prev_Z_BYTE = Z_BYTE;
7233 Lisp_Object val;
7234
7235 TEMP_SET_PT_BOTH (coding->dst_pos, coding->dst_pos_byte);
7236 GCPRO5 (coding->src_object, coding->dst_object, src_object, dst_object,
7237 old_deactivate_mark);
7238 val = safe_call1 (CODING_ATTR_POST_READ (attrs),
7239 make_number (coding->produced_char));
7240 UNGCPRO;
At conditional (14): "val & 7 != 0" taking false path
At conditional (15): "val >> 3 < 0" taking false path
At conditional (16): "0" taking false path
7241 CHECK_NATNUM (val);
7242 coding->produced_char += Z - prev_Z;
7243 coding->produced += Z_BYTE - prev_Z_BYTE;
7244 }
7245
At conditional (17): "dst_object == Qt" taking true path
7246 if (EQ (dst_object, Qt))
7247 {
7248 coding->dst_object = Fbuffer_string ();
7249 }
7250 else if (NILP (dst_object) && BUFFERP (coding->dst_object))
7251 {
7252 set_buffer_internal (XBUFFER (coding->dst_object));
7253 if (dst_bytes < coding->produced)
7254 {
7255 destination = xrealloc (destination, coding->produced);
7256 if (! destination)
7257 {
7258 record_conversion_result (coding,
7259 CODING_RESULT_INSUFFICIENT_DST);
7260 unbind_to (count, Qnil);
7261 return;
7262 }
7263 if (BEGV < GPT && GPT < BEGV + coding->produced_char)
7264 move_gap_both (BEGV, BEGV_BYTE);
7265 bcopy (BEGV_ADDR, destination, coding->produced);
7266 coding->destination = destination;
7267 }
7268 }
7269
At conditional (18): "saved_pt >= 0" taking true path
7270 if (saved_pt >= 0)
7271 {
7272 /* This is the case of:
7273 (BUFFERP (src_object) && EQ (src_object, dst_object))
7274 As we have moved PT while replacing the original buffer
7275 contents, we must recover it now. */
7276 set_buffer_internal (XBUFFER (src_object));
7277 current_buffer->text->inhibit_shrinking = 0;
At conditional (19): "saved_pt < from" taking false path
7278 if (saved_pt < from)
Event uninit_use_in_call: Using uninitialized value "saved_pt_byte" in call to function "temp_set_point_both" [model]
Also see events: [var_decl][uninit_use][uninit_use]
7279 TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte);
At conditional (20): "saved_pt < (from + chars)" taking false path
7280 else if (saved_pt < from + chars)
7281 TEMP_SET_PT_BOTH (from, from_byte);
At conditional (21): "(current_buffer)->enable_multibyte_characters != Qnil" taking true path
7282 else if (! NILP (current_buffer->enable_multibyte_characters))
Event uninit_use: Using uninitialized value "saved_pt_byte"
Also see events: [var_decl][uninit_use][uninit_use_in_call]
7283 TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars),
7284 saved_pt_byte + (coding->produced - bytes));
7285 else
Event uninit_use: Using uninitialized value "saved_pt_byte"
Also see events: [var_decl][uninit_use][uninit_use_in_call]
7286 TEMP_SET_PT_BOTH (saved_pt + (coding->produced - bytes),
7287 saved_pt_byte + (coding->produced - bytes));
7288
7289 if (need_marker_adjustment)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Problem report #113: base/src/emacs/src/coding.c (decode_coding_object); UNINIT
2008-12-02 22:23 Problem report #113: base/src/emacs/src/coding.c (decode_coding_object); UNINIT Dan Nicolaescu
@ 2008-12-02 23:31 ` Davis Herring
0 siblings, 0 replies; 2+ messages in thread
From: Davis Herring @ 2008-12-02 23:31 UTC (permalink / raw)
To: Dan Nicolaescu; +Cc: emacs-devel
> 7141 int saved_pt = -1, saved_pt_byte;
[...]
> 7178 saved_pt = PT, saved_pt_byte = PT_BYTE;
[...]
> At conditional (18): "saved_pt >= 0" taking true path
>
> 7270 if (saved_pt >= 0)
[...]
> Event uninit_use_in_call: Using uninitialized value "saved_pt_byte" in
> call to function "temp_set_point_both" [model]
> Also see events: [var_decl][uninit_use][uninit_use]
>
> 7279 TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte);
No bug: saved_pt starts negative and is assigned iff saved_pt_byte is.
Davis
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-02 23:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-02 22:23 Problem report #113: base/src/emacs/src/coding.c (decode_coding_object); UNINIT Dan Nicolaescu
2008-12-02 23:31 ` Davis Herring
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.