From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix a hash lookup problem in xfaces.c Date: Sat, 01 Jan 2022 11:59:18 +0200 Message-ID: <83h7ang4jt.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35847"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Zhehao Lin Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jan 01 10:59:58 2022 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 1n3bB6-000984-93 for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Jan 2022 10:59:56 +0100 Original-Received: from localhost ([::1]:55848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3bB4-0001F0-Tr for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Jan 2022 04:59:54 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3bAX-0000Yf-J6 for emacs-devel@gnu.org; Sat, 01 Jan 2022 04:59:21 -0500 Original-Received: from [2001:470:142:3::e] (port=60024 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3bAX-00046G-9K; Sat, 01 Jan 2022 04:59:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MIHy1NMn7r083F/05kN2DtkmFrsMyGNximr4HHDKF5A=; b=BBxNXxmGNIPe GrNRZE9oARSSnWCrAi0iUFeUjnW1VBEBTt3Fgeeaop7+kRbySmeCal4F+IiDPg0OGM8Z+QZMUKY5w b5lYTvwUsVTd0MkOxdQjSkbALQheRC5KdGENPavD+cl9gzoyZWax8NkbJQw2ky8vIN9TDWp6f5C3c nS3y5PVXlUNirp7fzN5MaH8lazfparyDSkfDRh2Vb9sR1uLhmpEFZNYcWQNNqt/AvCOyGmPRsubVf 4J9yLxTvtO2X3BhDsTfc+w1seqGPrm/eLJUWYFJ67MQyXMbQIprnXyNtJ0p7KxkTJf6rI1veahaDp +bFyJ+pdHaLH4FbZJv5EKQ==; Original-Received: from [87.69.77.57] (port=3701 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3bAX-000729-7M; Sat, 01 Jan 2022 04:59:21 -0500 In-Reply-To: (message from Zhehao Lin on Sat, 1 Jan 2022 17:24:27 +0800) 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" Xref: news.gmane.io gmane.emacs.devel:283795 Archived-At: > Date: Sat, 1 Jan 2022 17:24:27 +0800 > From: Zhehao Lin > > Hello, this patch fixes a problem in the `face_for_font` function in `src/ > xfaces.c` where an `unsigned` instead of an `uintptr_t` was used to > store the > computed hash value of the face. If the hash value was too large (>UINT_MAX) > and truncated, the lookup and storing (the latter uses `uintptr_t` as > the rest > of the program does) would happen in different buckets, resulting in > constant > cache misses. Thanks, installed on the emacs-28 branch.