From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Problem report #117: base/src/emacs/src/coding.c (encode_coding_object); UNINIT Date: Tue, 02 Dec 2008 16:59:20 -0800 Message-ID: <200812030116.mB31G0IE022796@mothra.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228267022 518 80.91.229.12 (3 Dec 2008 01:17:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2008 01:17:02 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 03 02:18:05 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L7gNP-0001k6-4q for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 02:18:03 +0100 Original-Received: from localhost ([127.0.0.1]:36195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7gME-0001n3-LL for ged-emacs-devel@m.gmane.org; Tue, 02 Dec 2008 20:16:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7gLY-0001VR-Tx for emacs-devel@gnu.org; Tue, 02 Dec 2008 20:16:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7gLY-0001V8-Hq for emacs-devel@gnu.org; Tue, 02 Dec 2008 20:16:08 -0500 Original-Received: from [199.232.76.173] (port=37391 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7gLY-0001V0-1a for emacs-devel@gnu.org; Tue, 02 Dec 2008 20:16:08 -0500 Original-Received: from barrelv2.ics.uci.edu ([128.195.1.114]:48629) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1L7gLX-0007Td-JO for emacs-devel@gnu.org; Tue, 02 Dec 2008 20:16:07 -0500 Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by barrelv2.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id mB31G0RZ017305 for ; Tue, 2 Dec 2008 17:16:00 -0800 (PST) Original-Received: (from dann@localhost) by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id mB31G0IE022796; Tue, 2 Dec 2008 17:16:00 -0800 (PST) Original-Lines: 235 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: mB31G0RZ017305 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.363, required 5, autolearn=disabled, ALL_TRUSTED -1.44, TW_GC 0.08) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:106465 Archived-At: 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