From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#8215: possibly uninitialized variable lower_xoff in produce_glyphless_glyph Date: Wed, 02 Jun 2021 10:06:29 +0200 Message-ID: <87k0ncelmi.fsf@gnus.org> References: <4D77F86C.9080809@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16099"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 8215@debbugs.gnu.org, Kenichi Handa To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 02 10:07:41 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loLuf-00045p-6u for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Jun 2021 10:07:41 +0200 Original-Received: from localhost ([::1]:59506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loLue-0007tY-97 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Jun 2021 04:07:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loLu2-0007Cb-GG for bug-gnu-emacs@gnu.org; Wed, 02 Jun 2021 04:07:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55419) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1loLu2-0006De-8V for bug-gnu-emacs@gnu.org; Wed, 02 Jun 2021 04:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1loLu2-0004dQ-3T for bug-gnu-emacs@gnu.org; Wed, 02 Jun 2021 04:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Jun 2021 08:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8215 X-GNU-PR-Package: emacs Original-Received: via spool by 8215-submit@debbugs.gnu.org id=B8215.162262120917797 (code B ref 8215); Wed, 02 Jun 2021 08:07:02 +0000 Original-Received: (at 8215) by debbugs.gnu.org; 2 Jun 2021 08:06:49 +0000 Original-Received: from localhost ([127.0.0.1]:38732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loLti-0004cr-PY for submit@debbugs.gnu.org; Wed, 02 Jun 2021 04:06:49 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:55376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loLtg-0004ce-LX for 8215@debbugs.gnu.org; Wed, 02 Jun 2021 04:06:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZhvZOlGcNp9JcgpYojdNfqG18tjeWQBa6Xmq27gqX4I=; b=O7NuGtFhdMdNn+84S2NI8a53Si wj5HlhAvqQLvuIhxba6ouxtCEtYpAqI5PlCutZwzLgqptBn9VvfkeXHnPtsaeMZZAkPggxFaFK8sI Vkz5UFdpMUYrkGbiL0E173lMXUQKdqne3uL774lvi27aDFJ9CxM8/Hn6ueF8Xw45Mwa8=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loLtV-0003ck-Pn; Wed, 02 Jun 2021 10:06:33 +0200 X-Now-Playing: Nobukazu Takemura's _Child's View_: "Ill At Ease" In-Reply-To: <4D77F86C.9080809@cs.ucla.edu> (Paul Eggert's message of "Wed, 09 Mar 2011 14:00:12 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207846 Archived-At: Paul Eggert writes: > In the meantime, I plan to work around the problem by initializing > lower_xoff to 0, with a FIXME explaining the situation: this shouldn't > introduce a bug, because at worst it will replace undefined behavior > with defined behavior. It looks like this code is still in place now, ten years later: diff --git a/src/xdisp.c b/src/xdisp.c index 44cb713011..44a317b578 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22292,7 +22292,13 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym) if (metrics_upper.width >= metrics_lower.width) lower_xoff = (width - metrics_lower.width) / 2; else - upper_xoff = (width - metrics_upper.width) / 2; + { + /* FIXME: This code doesn't look right. It formerly was + missing the "lower_xoff = 0;", which couldn't have + been right since it left lower_xoff uninitialized. */ + lower_xoff = 0; + upper_xoff = (width - metrics_upper.width) / 2; + } } /* +5 is for horizontal bars of a box plus 1-pixel spaces at Anybody have any insight into whether this is correct or not now? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no