From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EE2533858C2C; Thu, 9 Sep 2021 14:53:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE2533858C2C From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug ada/28323] segfault in ada_is_unconstrained_packed_array_type Date: Thu, 09 Sep 2021 14:53:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: ada X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 14:53:11 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28323 --- Comment #2 from Tom de Vries --- This seems to fix it: ... $ git diff diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 6680a4fd657..b1ed66c12c4 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -1974,6 +1974,8 @@ ada_is_unconstrained_packed_array_type (struct type *type) /* The structure's first field is a pointer to an array, so this fetches the array type. */ type =3D TYPE_TARGET_TYPE (type->field (0).type ()); + if (type->code () =3D=3D TYPE_CODE_TYPEDEF) + type =3D ada_typedef_target_type (type); /* Now we can see if the array elements are packed. */ return TYPE_FIELD_BITSIZE (type, 0) > 0; } ... But I have no idea whether the fix is correct. --=20 You are receiving this mail because: You are on the CC list for the bug.=