public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-5515] Fix crash in libcc1
Date: Thu, 16 Nov 2023 04:45:30 +0000 (GMT)	[thread overview]
Message-ID: <20231116044530.11E413858D20@sourceware.org> (raw)

https://gcc.gnu.org/g:6d16e460240fe547cb7d9648f91494126213c835

commit r14-5515-g6d16e460240fe547cb7d9648f91494126213c835
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Nov 14 22:27:52 2023 -0700

    Fix crash in libcc1
    
    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.
    
    
            * libcc1plugin.cc (plugin_build_enum_type): Set
            ENUM_UNDERLYING_TYPE.

Diff:
---
 libcc1/libcc1plugin.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc
index 283eaf20685..34dcd89b1b3 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<plugin_context *> (self);
   return convert_out (ctx->preserve (result));

                 reply	other threads:[~2023-11-16  4:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231116044530.11E413858D20@sourceware.org \
    --to=tromey@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).