From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Problem report #60 Date: Tue, 11 Apr 2006 20:02:55 +0200 Message-ID: <857j5w7zxs.fsf@lola.goethe.zz> References: <200604111548.k3BFmXjS015097@scanner2.ics.uci.edu> <39868.128.165.123.132.1144778085.squirrel@webmail.lanl.gov> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1144778623 3794 80.91.229.2 (11 Apr 2006 18:03:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Apr 2006 18:03:43 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 11 20:03:41 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FTND1-0005Fe-NH for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2006 20:03:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTNCz-0004ZZ-SY for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2006 14:03:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FTNCn-0004ZI-7u for emacs-devel@gnu.org; Tue, 11 Apr 2006 14:03:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FTNCl-0004Yx-Uo for emacs-devel@gnu.org; Tue, 11 Apr 2006 14:03:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTNCl-0004Yu-PX for emacs-devel@gnu.org; Tue, 11 Apr 2006 14:03:07 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FTNHf-0003IH-O0 for emacs-devel@gnu.org; Tue, 11 Apr 2006 14:08:11 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1FTNCg-0002zV-9g; Tue, 11 Apr 2006 14:03:02 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 4C2991C3DB49; Tue, 11 Apr 2006 20:02:56 +0200 (CEST) Original-To: herring@lanl.gov In-Reply-To: <39868.128.165.123.132.1144778085.squirrel@webmail.lanl.gov> (Stuart D. Herring's message of "Tue, 11 Apr 2006 10:54:45 -0700 (PDT)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:52706 Archived-At: "Stuart D. Herring" writes: >> 8608 volatile Lisp_Object original_uppercase; >> 8609 volatile int original_uppercase_position = -1; >> [...] > > original_uppercase_position remains -1 if original_uppercase is > uninitialized. > >> At conditional (20): "dont_downcase_last != 0" taking true path >> At conditional (21): "(t - 1) == original_uppercase_position" taking true >> path >> >> 9481 if ((dont_downcase_last || first_binding >= nmaps) >> 9482 && t - 1 == original_uppercase_position) > > Assuming that t!=0, t-1==original_uppercase_position implies that the o_u > variables were set. > >> Event uninit_use: Using uninitialized value "original_uppercase" >> Also see events: [var_decl] >> >> 9483 keybuf[t - 1] = original_uppercase; >> 9484 > > So this is fine. It'd be a big bug if t were 0, though, indexing at -1 > like that. Looking back up, it seems that if the while loop iterates even > once, t is > 0, but what if the while test fails the first time? It looks > like t would be 0, and original_uppercase_position would still be -1, and > uninitialized data would be stored outside of an array. Nasty, if it can > happen. Otherwise, no bug. Then this should not be written as while (condition) { body } but rather assert(condition); do { body } while (condition); -- David Kastrup, Kriemhildstr. 15, 44793 Bochum