From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: "Final" version of tty child frames Date: Tue, 22 Oct 2024 12:19:44 -0700 Organization: UCLA Computer Science Department Message-ID: <8400b5c9-4de6-4ba7-88f2-bcb68b57143b@cs.ucla.edu> References: <86ttd4ftvs.fsf@gnu.org> <86plnsfp7j.fsf@gnu.org> <86ldygfeg8.fsf@gnu.org> <86h694fdi8.fsf@gnu.org> <86cyjsfbey.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------0I0xNdgN5a005q6MSppmGEHL" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8625"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel@gnu.org, =?UTF-8?Q?Gerd_M=C3=B6llmann?= To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 22 21:20:47 2024 Return-path: Envelope-to: ged-emacs-devel@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 1t3KQx-000261-7y for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Oct 2024 21:20:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3KQ9-000639-4M; Tue, 22 Oct 2024 15:19:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3KQ4-00062P-Go for emacs-devel@gnu.org; Tue, 22 Oct 2024 15:19:52 -0400 Original-Received: from mail.cs.ucla.edu ([131.179.128.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3KPz-0007dZ-VW; Tue, 22 Oct 2024 15:19:50 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 413863C00FAAB; Tue, 22 Oct 2024 12:19:45 -0700 (PDT) Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id TSUJellHBQM3; Tue, 22 Oct 2024 12:19:45 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id E8A4B3C00FAAC; Tue, 22 Oct 2024 12:19:44 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu E8A4B3C00FAAC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1729624785; bh=SuDL1t6+ufQ6yyXIDI2hawPox9RHJMh3+9iic4Hm6RY=; h=Message-ID:Date:MIME-Version:To:From; b=c7uA6mEOO8RT+pxL7xaLW9TE31OZzli05j6w1DOx3ywhzlcDCVfJYYQyOntBkG+4S nMRd7Q3x4KqT3Cz0GshrTa6GCIqe5zVd5luWGWBAKAoYhTHRLGBfw0eo4DFfWYQmue 3cM25D11mCsjYIFB6JKRZnPci5LeF4d9bNCsNY/UIo4orKYD2tcXj1qq3AumTCIJQT AzU1Y94PVJtZ5+cI5/E9lb+GVupK7wvicwDGvUydJ55oZO08Vf1N/sl/ODP+tXEbv6 PIo6KSK/Js0HA9XpbAZ4gbmd20SVmtcsbW+36obO427Fgg8RdsmdlzbTTXrnTQfLw2 ZFtjpcapabuXw== X-Virus-Scanned: amavis at mail.cs.ucla.edu Original-Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 33iITUYjObV0; Tue, 22 Oct 2024 12:19:44 -0700 (PDT) Original-Received: from [192.168.254.12] (unknown [47.150.137.250]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id C4E743C00FAA8; Tue, 22 Oct 2024 12:19:44 -0700 (PDT) Content-Language: en-US In-Reply-To: <86cyjsfbey.fsf@gnu.org> Received-SPF: pass client-ip=131.179.128.66; envelope-from=eggert@cs.ucla.edu; helo=mail.cs.ucla.edu X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:324751 Archived-At: This is a multi-part message in MIME format. --------------0I0xNdgN5a005q6MSppmGEHL Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024-10-22 07:40, Eli Zaretskii wrote: > Paul, should we make line_hash_code return 'size_t' instead (and > change the data type of the variables in 'scrolling' accordingly)? Or > maybe we should simply mask off high bits of the face_cache's pointer, > leaving only the low 32 bits, before adding it to the hash? Either approach should be correct. The attached (untested and uninstalled) patch does the equivalent of the latter, which is simpler. I don't know whether the more-complicated one would perform better. This patch also fixes a glitch in that one should cast pointers to uintptr_t or to intptr_t, not to ptrdiff_t. The difference can matter on unusual platforms like CheriBSD where uintptr_t is wider than ptrdiff_t. --------------0I0xNdgN5a005q6MSppmGEHL Content-Type: text/x-patch; charset=UTF-8; name="0001-Fix-UB-in-line_hash_code.patch" Content-Disposition: attachment; filename="0001-Fix-UB-in-line_hash_code.patch" Content-Transfer-Encoding: base64 RnJvbSBmNjI0NjYxZWVjODU0ZjA5YjI4MDc2YjhmMWJmODBiMWVkMzI2NDc1IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBUdWUsIDIyIE9jdCAyMDI0IDEyOjE4OjE0IC0wNzAwClN1YmplY3Q6IFtQQVRD SF0gRml4IFVCIGluIGxpbmVfaGFzaF9jb2RlCgoqIHNyYy9kaXNwbmV3LmMgKGxpbmVfaGFz aF9jb2RlKTogQXZvaWQgdW5kZWZpbmVkIGJlaGF2aW9yIG9uCmludGVnZXIgb3ZlcmZsb3cu Ci0tLQogc3JjL2Rpc3BuZXcuYyB8IDQgKystLQogMSBmaWxlIGNoYW5nZWQsIDIgaW5zZXJ0 aW9ucygrKSwgMiBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9zcmMvZGlzcG5ldy5jIGIv c3JjL2Rpc3BuZXcuYwppbmRleCAyMDBmZmFhY2EyMS4uMWVjZTljYzFkNDUgMTAwNjQ0Ci0t LSBhL3NyYy9kaXNwbmV3LmMKKysrIGIvc3JjL2Rpc3BuZXcuYwpAQCAtMTE3NSwxMiArMTE3 NSwxMiBAQCBsaW5lX2hhc2hfY29kZSAoc3RydWN0IGZyYW1lICpmLCBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3cpCiAgICAgICB3aGlsZSAoZ2x5cGggPCBlbmQpCiAJewogCSAgaW50IGMgPSBn bHlwaC0+dS5jaDsKLQkgIGludCBmYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisJICB1bnNp Z25lZCBpbnQgZmFjZV9pZCA9IGdseXBoLT5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