diff options
author | Tom Tromey <tom@tromey.com> | 2023-11-14 22:27:52 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-11-15 21:45:34 -0700 |
commit | 6d16e460240fe547cb7d9648f91494126213c835 (patch) | |
tree | 59f1161712b2fba709516d856dce975ff26e38a0 | |
parent | 70060dadfbf0d0af5f4cab5f3aff3223a4523606 (diff) | |
download | gcc-6d16e460240fe547cb7d9648f91494126213c835.zip gcc-6d16e460240fe547cb7d9648f91494126213c835.tar.gz gcc-6d16e460240fe547cb7d9648f91494126213c835.tar.bz2 |
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.
-rw-r--r-- | libcc1/libcc1plugin.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libcc1/libcc1plugin.cc b/libcc1/libcc1plugin.cc index 283eaf2..34dcd89 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)); |