[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem report #117: base/src/emacs/src/coding.c (encode_coding_object);
From: |
Dan Nicolaescu |
Subject: |
Problem report #117: base/src/emacs/src/coding.c (encode_coding_object); UNINIT |
Date: |
Tue, 02 Dec 2008 16:59:20 -0800 |
CID: 117
Checker: UNINIT (help)
File: base/src/emacs/src/coding.c
Function: encode_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]
7330 int saved_pt = -1, saved_pt_byte;
7331 int need_marker_adjustment = 0;
7332 int kill_src_buffer = 0;
7333 Lisp_Object old_deactivate_mark;
7334
7335 old_deactivate_mark = Vdeactivate_mark;
7336
7337 coding->src_object = src_object;
7338 coding->src_chars = chars;
7339 coding->src_bytes = bytes;
7340 coding->src_multibyte = chars < bytes;
7341
7342 attrs = CODING_ID_ATTRS (coding->id);
7343
At conditional (1): "src_object == dst_object" taking true path
7344 if (EQ (src_object, dst_object))
7345 {
7346 struct Lisp_Marker *tail;
7347
At conditional (2): "tail != 0" taking true path
At conditional (5): "tail != 0" taking true path
At conditional (8): "tail != 0" taking false path
7348 for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next)
7349 {
At conditional (3): "(tail)->insertion_type != 0" taking true path
At conditional (4): "(tail)->charpos == (((tail)->insertion_type != 0) ? from :
(to))" taking true path
At conditional (6): "(tail)->insertion_type != 0" taking true path
At conditional (7): "(tail)->charpos == (((tail)->insertion_type != 0) ? from :
(to))" taking false path
7350 tail->need_adjustment
7351 = tail->charpos == (tail->insertion_type ? from : to);
7352 need_marker_adjustment |= tail->need_adjustment;
7353 }
7354 }
7355
At conditional (9): "((0), (attrs & -8))->contents[10] != Qnil" taking false
path
7356 if (! NILP (CODING_ATTR_PRE_WRITE (attrs)))
7357 {
7358 coding->src_object = code_conversion_save (1,
coding->src_multibyte);
7359 set_buffer_internal (XBUFFER (coding->src_object));
7360 if (STRINGP (src_object))
7361 insert_from_string (src_object, from, from_byte, chars, bytes,
0);
7362 else if (BUFFERP (src_object))
7363 insert_from_buffer (XBUFFER (src_object), from, chars, 0);
7364 else
7365 insert_1_both (coding->source + from, chars, bytes, 0, 0, 0);
7366
7367 if (EQ (src_object, dst_object))
7368 {
7369 set_buffer_internal (XBUFFER (src_object));
7370 saved_pt = PT, saved_pt_byte = PT_BYTE;
7371 del_range_both (from, from_byte, to, to_byte, 1);
7372 set_buffer_internal (XBUFFER (coding->src_object));
7373 }
7374
7375 {
7376 Lisp_Object args[3];
7377 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
7378
7379 GCPRO5 (coding->src_object, coding->dst_object, src_object,
dst_object,
7380 old_deactivate_mark);
7381 args[0] = CODING_ATTR_PRE_WRITE (attrs);
7382 args[1] = make_number (BEG);
7383 args[2] = make_number (Z);
7384 safe_call (3, args);
7385 UNGCPRO;
7386 }
7387 if (XBUFFER (coding->src_object) != current_buffer)
7388 kill_src_buffer = 1;
7389 coding->src_object = Fcurrent_buffer ();
7390 if (BEG != GPT)
7391 move_gap_both (BEG, BEG_BYTE);
7392 coding->src_chars = Z - BEG;
7393 coding->src_bytes = Z_BYTE - BEG_BYTE;
7394 coding->src_pos = BEG;
7395 coding->src_pos_byte = BEG_BYTE;
7396 coding->src_multibyte = Z < Z_BYTE;
7397 }
At conditional (10): "src_object & 7 == 3" taking true path
7398 else if (STRINGP (src_object))
7399 {
7400 code_conversion_save (0, 0);
7401 coding->src_pos = from;
7402 coding->src_pos_byte = from_byte;
7403 }
7404 else if (BUFFERP (src_object))
7405 {
7406 code_conversion_save (0, 0);
7407 set_buffer_internal (XBUFFER (src_object));
7408 if (EQ (src_object, dst_object))
7409 {
7410 saved_pt = PT, saved_pt_byte = PT_BYTE;
7411 coding->src_object = del_range_1 (from, to, 1, 1);
7412 coding->src_pos = 0;
7413 coding->src_pos_byte = 0;
7414 }
7415 else
7416 {
7417 if (from < GPT && to >= GPT)
7418 move_gap_both (from, from_byte);
7419 coding->src_pos = from;
7420 coding->src_pos_byte = from_byte;
7421 }
7422 }
7423 else
7424 code_conversion_save (0, 0);
7425
At conditional (11): "dst_object & 7 == 4" taking true path
At conditional (12): "((0), (dst_object & -8))->size & 4611686018427518976 ==
4611686018427518976" taking true path
7426 if (BUFFERP (dst_object))
7427 {
7428 coding->dst_object = dst_object;
At conditional (13): "src_object == dst_object" taking true path
7429 if (EQ (src_object, dst_object))
7430 {
7431 coding->dst_pos = from;
7432 coding->dst_pos_byte = from_byte;
7433 }
7434 else
7435 {
7436 struct buffer *current = current_buffer;
7437
7438 set_buffer_temp (XBUFFER (dst_object));
7439 coding->dst_pos = PT;
7440 coding->dst_pos_byte = PT_BYTE;
7441 move_gap_both (coding->dst_pos, coding->dst_pos_byte);
7442 set_buffer_temp (current);
7443 }
At conditional (14): "((0), (dst_object & -8))->enable_multibyte_characters !=
Qnil" taking true path
7444 coding->dst_multibyte
7445 = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters);
7446 }
7447 else if (EQ (dst_object, Qt))
7448 {
7449 coding->dst_object = Qnil;
7450 coding->dst_bytes = coding->src_chars;
7451 if (coding->dst_bytes == 0)
7452 coding->dst_bytes = 1;
7453 coding->destination = (unsigned char *) xmalloc
(coding->dst_bytes);
7454 coding->dst_multibyte = 0;
7455 }
7456 else
7457 {
7458 coding->dst_object = Qnil;
7459 coding->dst_multibyte = 0;
7460 }
7461
7462 encode_coding (coding);
7463
At conditional (15): "dst_object == Qt" taking true path
7464 if (EQ (dst_object, Qt))
7465 {
At conditional (16): "(coding)->dst_object & 7 == 4" taking true path
At conditional (17): "((0), ((coding)->dst_object & -8))->size &
4611686018427518976 == 4611686018427518976" taking true path
7466 if (BUFFERP (coding->dst_object))
7467 coding->dst_object = Fbuffer_string ();
7468 else
7469 {
7470 coding->dst_object
7471 = make_unibyte_string ((char *) coding->destination,
7472 coding->produced);
7473 xfree (coding->destination);
7474 }
7475 }
7476
At conditional (18): "saved_pt >= 0" taking true path
7477 if (saved_pt >= 0)
7478 {
7479 /* This is the case of:
7480 (BUFFERP (src_object) && EQ (src_object, dst_object))
7481 As we have moved PT while replacing the original buffer
7482 contents, we must recover it now. */
7483 set_buffer_internal (XBUFFER (src_object));
At conditional (19): "saved_pt < from" taking false path
7484 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]
7485 TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte);
At conditional (20): "saved_pt < (from + chars)" taking false path
7486 else if (saved_pt < from + chars)
7487 TEMP_SET_PT_BOTH (from, from_byte);
At conditional (21): "(current_buffer)->enable_multibyte_characters != Qnil"
taking true path
7488 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]
7489 TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars),
7490 saved_pt_byte + (coding->produced - bytes));
7491 else
Event uninit_use: Using uninitialized value "saved_pt_byte"
Also see events: [var_decl][uninit_use][uninit_use_in_call]
7492 TEMP_SET_PT_BOTH (saved_pt + (coding->produced - bytes),
7493 saved_pt_byte + (coding->produced - bytes));
7494
- Problem report #117: base/src/emacs/src/coding.c (encode_coding_object); UNINIT,
Dan Nicolaescu <=