From patchwork Wed Nov 15 05:30:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 165186 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:a59:b0:164:83eb:24d7 with SMTP id 25csp2403693rwb; Tue, 14 Nov 2023 21:30:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtIQhT6dF6xWcoM0Kw3bIK/3w6nnoHaGGLfrClmy4wPkdW3DQh92vPhZPxn7nzy8Z0CDzl X-Received: by 2002:a05:6102:3712:b0:45e:7768:6e1a with SMTP id s18-20020a056102371200b0045e77686e1amr13689507vst.15.1700026236833; Tue, 14 Nov 2023 21:30:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700026236; cv=pass; d=google.com; s=arc-20160816; b=lcHnD/MbN/QK+tBF8bkImA2AaNWqPkIGPDAD8dp+9SU3rs1Mu8DZychNnwblLR8iA9 D2s8jusMPA+XI0oXwtkinF5SD9Bx5SJnLJ5/8R/AtAhgrz1qsJ258KIZ88hHV1to6GCw YU3sddlclHPv8zmTyfMH2RrztURvV2DOb9tHBosece9m+ragk/bXNxaE42eQs9uZ2OVU K/JxvklyH6+8Lo+a7S11rHY8ll82tjPTk8DbnhRLwNSTJ9SMSEq3ZzwMIkc2zIiWUZhp s2Y72mTtODoFfqpjsCjoMZ+hthr4rDIJI+c8DB8Jj2zR9aqDKwD/3bkGBw+Qu5qen4gD O2Lg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=c623FyI6yEd8+LGu4UFCrF6/yLw8uZ5ivkbQdOz23ak=; fh=UkALm6u9HBVb33v0GLqDRUaiFqNrKJ2Id7ZMLIjWvzU=; b=YtEiLFXnGAg1/Uusz5GuixPycir38U8lBuy3tbsaGtS6pBKizkAY6tD29lp22HDloW sdF45XtXEo4WKp/EYjW+OPoQXAKf+kYuvuGYaC4FP8sHxXG7WJ99EXihWzOtFGaXrcsL kDL/hcMiIKPYAMh8LK+Ez/WQUI2o5qj0qCjVgPH/ZjddFqDOF+vnrznRLg2y2kC8w8VS 5kXtHu3EgQM/mXDMQtA3ZjYd5kpQ3acq0E/VhseRu/yKcT2czI6AvgENPTBqKbBFEKoA DZaO1WVmy/0OK+4pz9zh0A89Uk7Xs8G3G6RZkG5EKBnAPO8KsDU+3ttzMvUiRK9Yx4+S cPMA== ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@tromey.com header.s=default header.b=vku3oii6; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id rg3-20020a05620a8ec300b007743391acf0si7262677qkn.324.2023.11.14.21.30.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 21:30:36 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=fail header.i=@tromey.com header.s=default header.b=vku3oii6; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9440D3858403 for ; Wed, 15 Nov 2023 05:30:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id AA9D13858D20 for ; Wed, 15 Nov 2023 05:30:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AA9D13858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AA9D13858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700026213; cv=none; b=AaQ75KS3VK+7rSIPwEfRBH+gquCkTD6v8ciDDEIm9VwcXyLCz4xp0Tfcw031luERV4cY0PwgVv7NYbsHYcg5paMeBTLKXWh2RKtD6GrUTP2+KzkvIjeLEJuj3BGP8cBaaUVpzfrGP2nf6cmwZUHNx1CbRBImSkuxixITTCN4k9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700026213; c=relaxed/simple; bh=2GS/Z4aHRpX12Rf+apvHXgaS2q+b7HqK5N27+lkkF5U=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=cJbvBnMUs6qw5AjUtkHQfjEJnQm8yRoK9Yp2yLnoQlzwBX5VxlRYkcNw4kDLYShXn1x724cooUD3Mm8jfJ72vybRtA2lIGbvSTFtIe8l7YMS1XNmQ6BB+IVrv+QvPgxWn+2+BYzFufV1hOgbhfCo1HmhUQQL1Ysy8ubytY1Esdg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6008a.ext.cloudfilter.net ([10.0.30.227]) by cmsmtp with ESMTPS id 2vMGrHe5fWcCI38TarkrPk; Wed, 15 Nov 2023 05:30:10 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 38TZr1ql50xkr38TZr3Amd; Wed, 15 Nov 2023 05:30:09 +0000 X-Authority-Analysis: v=2.4 cv=N7U6qkxB c=1 sm=1 tr=0 ts=65545761 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=BNY50KLci1gA:10 a=Qbun_eYptAEA:10 a=DsrQZkkA-U4HnjCswOYA:9 a=zZCYzV9kfG8A:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=c623FyI6yEd8+LGu4UFCrF6/yLw8uZ5ivkbQdOz23ak=; b=vku3oii6VODVyevZIv3Mf+zUVb buLoX0ZQfEcv1E1+kji7Pt1thoW6i/A6d+ovjDIxev+HzMHFbu8Cn8HcGXOeHyeeI9c2LEfwMJT5y ggL24+NnoHgl0oQXWGLOvNeUz; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:59752 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1r38TY-003brL-37; Tue, 14 Nov 2023 22:30:09 -0700 From: Tom Tromey To: gcc-patches@gcc.gnu.org Cc: Tom Tromey Subject: [PATCH] Fix crash in libcc1 Date: Tue, 14 Nov 2023 22:30:14 -0700 Message-ID: <20231115053014.166349-1-tom@tromey.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.77.73 X-Source-L: No X-Exim-ID: 1r38TY-003brL-37 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-77-73.hlrn.qwest.net (localhost.localdomain) [97.122.77.73]:59752 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfLTv8dRehHIQJvzy/Y6tvAox6QLS3duim29Xhwukrwdm8halsTqRYxdKoihmEA4cutpYNaID2RBJExtvNpZ2vt4LJl+z0iWe3OAmBaDRcZiXIEPZioxS aR5///I8Pe3A62cP/nRsMD1uFrZ30F+Mx7fFPTMAx4O6NnfFRb1jTe/FhItXT1cVzMrRBz0RCuh10/p8sCOWkR/i7hjKzkSiV6A= X-Spam-Status: No, score=-3023.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782606711383645387 X-GMAIL-MSGID: 1782606711383645387 The gdb tests of the libcc1 plugin have been failing lately. I tracked this down to a crash trying to access an enum's underlying type. This patch fixes the crash by setting this type. libcc1/ChangeLog * libcc1plugin.cc (plugin_build_enum_type): Set ENUM_UNDERLYING_TYPE. --- libcc1/libcc1plugin.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc index 283eaf206850..34dcd89b1b33 100644 --- a/libcc1/libcc1plugin.cc +++ b/libcc1/libcc1plugin.cc @@ -454,6 +454,7 @@ plugin_build_enum_type (cc1_plugin::connection *self, TYPE_PRECISION (result) = TYPE_PRECISION (underlying_int_type); TYPE_UNSIGNED (result) = TYPE_UNSIGNED (underlying_int_type); + ENUM_UNDERLYING_TYPE (result) = underlying_int_type; plugin_context *ctx = static_cast (self); return convert_out (ctx->preserve (result));