From debbugs-submit-bounces@debbugs.gnu.org Sun May 01 12:59:38 2011 Received: (at submit) by debbugs.gnu.org; 1 May 2011 16:59:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QGZze-0006UE-71 for submit@debbugs.gnu.org; Sun, 01 May 2011 12:59:38 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QGZzc-0006U3-Hi for submit@debbugs.gnu.org; Sun, 01 May 2011 12:59:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QGZzW-00075M-Sz for submit@debbugs.gnu.org; Sun, 01 May 2011 12:59:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:36956) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGZzW-00075I-R9 for submit@debbugs.gnu.org; Sun, 01 May 2011 12:59:30 -0400 Received: from eggs.gnu.org ([140.186.70.92]:59618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGZzV-0005c8-RP for bug-gnu-emacs@gnu.org; Sun, 01 May 2011 12:59:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QGZzV-00074Z-2a for bug-gnu-emacs@gnu.org; Sun, 01 May 2011 12:59:29 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:49594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGZzU-00074T-Pf for bug-gnu-emacs@gnu.org; Sun, 01 May 2011 12:59:29 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id A460D39E8109 for ; Sun, 1 May 2011 09:59:27 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ao+2QhNtM6Vj for ; Sun, 1 May 2011 09:59:26 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B1F7839E80F8 for ; Sun, 1 May 2011 09:59:26 -0700 (PDT) Message-ID: <4DBD916D.6000804@cs.ucla.edu> Date: Sun, 01 May 2011 09:59:25 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: struct charset.code_space[15] contains garbage Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.7 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.7 (----) While testing the 32+64 port I noticed that a too-wide value is stuffed into charset.code_space[15], which means that slot has a garbage value (at least, it's garbage on typical machines with 32-bit int). As far as I can see, the garbage value is never used, so it's a bit cleaner to never compute or store it. I plan to install the following patch to do that. This patch is relevant to ordinary 32- and 64-bit hosts, too, so I'm separating it out. * charset.h (struct charset.code_space): Now has 15 elements, not 16. * charset.c (Fdefine_charset_internal): Don't initialize charset.code_space[15]. The value was garbage, on hosts with 32-bit int. === modified file 'src/charset.c' --- src/charset.c 2011-04-26 06:17:52 +0000 +++ src/charset.c 2011-05-01 06:28:23 +0000 @@ -869,7 +869,7 @@ ASET (attrs, charset_name, args[charset_arg_name]); val = args[charset_arg_code_space]; - for (i = 0, dimension = 0, nchars = 1; i < 4; i++) + for (i = 0, dimension = 0, nchars = 1; ; i++) { int min_byte, max_byte; @@ -880,10 +880,12 @@ charset.code_space[i * 4] = min_byte; charset.code_space[i * 4 + 1] = max_byte; charset.code_space[i * 4 + 2] = max_byte - min_byte + 1; + if (max_byte > 0) + dimension = i + 1; + if (i == 3) + break; nchars *= charset.code_space[i * 4 + 2]; charset.code_space[i * 4 + 3] = nchars; - if (max_byte > 0) - dimension = i + 1; } val = args[charset_arg_dimension]; === modified file 'src/charset.h' --- src/charset.h 2011-04-11 06:48:18 +0000 +++ src/charset.h 2011-05-01 16:22:33 +0000 @@ -155,10 +155,11 @@ byte code of the (N+1)th dimension, [4N+1] is a maximum byte code of the (N+1)th dimension, [4N+2] is ([4N+1] - [4N] + 1), [4N+3] - is a number of characters containd in the first to (N+1)th - dismesions. We get `char-index' of a `code-point' from this + is the number of characters contained in the first through (N+1)th + dimensions, except that there is no [15]. + We get `char-index' of a `code-point' from this information. */ - int code_space[16]; + int code_space[15]; /* If B is a byte of Nth dimension of a code-point, the (N-1)th bit of code_space_mask[B] is set. This array is used to quickly From debbugs-submit-bounces@debbugs.gnu.org Fri May 06 03:30:08 2011 Received: (at 8600-done) by debbugs.gnu.org; 6 May 2011 07:30:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QIFUF-00031R-0E for submit@debbugs.gnu.org; Fri, 06 May 2011 03:30:07 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QIFUC-00030V-8W; Fri, 06 May 2011 03:30:05 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id AA3A539E8118; Fri, 6 May 2011 00:29:57 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nku4im7TOEsc; Fri, 6 May 2011 00:29:57 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 2BCF039E8113; Fri, 6 May 2011 00:29:57 -0700 (PDT) Message-ID: <4DC3A374.1090401@cs.ucla.edu> Date: Fri, 06 May 2011 00:29:56 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: 8545@debbugs.gnu.org, 8600-done@debbugs.gnu.org, 8601-done@debbugs.gnu.org, 8602-done@debbugs.gnu.org Subject: Merged fixes for 8600, 8601, 8602, and (partially) for 8545 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 8600-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) I committed to the Emacs trunk a merge (bzr 104134) that has fixes for the following bugs: * Bug#8600 - The fix removes the garbage element of code_space. * Bug#8601 - Here I assumed that the "* 2" is a typo. * Bug#8602 - This fixes some large-int-to-float screwups in the Lisp reader. * Bug#8545 - This fixes the bug where the code should have called va_copy, but didn't. Also, I changed a limit so that the MOST_POSITIVE_FIXNUM limit for strings applies to their length, i.e., does not include the null termination byte. Stefan hasn't had time to chime in, but if this last change turns out to be incorrect I will back it out. This merge doesn't entirely fix Bug#8545, so I'll leave that bug open; the others I'll close. From unknown Fri Jun 20 07:28:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 03 Jun 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator