Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Tankut Baris Aktemur <tankutbaris.aktemur@amd.com>,
	gdb-patches@sourceware.org
Cc: tom@tromey.com
Subject: Re: [PATCH v2] gdb: prefer lhs type's address spaces/classes in check_typedef
Date: Thu, 30 Jul 2026 11:12:44 -0700	[thread overview]
Message-ID: <88a0ad4f-e16f-458a-84c6-a0298fad149e@redhat.com> (raw)
In-Reply-To: <20260730091357.2528178-1-tankutbaris.aktemur@amd.com>

On 7/30/26 2:13 AM, Tankut Baris Aktemur wrote:
> In commit 92fdad7 "gdb: convert type instance flags to bitfields",
> `operator|=` of type_instance_flags required the address space and
> address class values of left-hand-side to be zero.  This introduced
> the following bug (thanks to Keith Seitz for reporting it at
> https://inbox.sourceware.org/gdb-patches/053e90c0-53f0-4748-9d27-0237b9f21221@redhat.com/T/#u):
> 
> So, the assertion in operator|= was wrong.  The outer type, which is
> the left-hand-side in this case, should preserve its values if they
> are non-zero.  The right-hand-side values are used, if lhs values are
> zero.  Fix the bug accordingly.
> 
> Furthermore, rename operator|= to "merge".  Type instance flags are no
> longer stored as a bitmask value, but rather as a struct.  Having an
> operator like |= gives the wrong impression that we are doing a
> bitmask OR.  Using a method makes the intention clearer.
> 
> Include a regression test.

This LGTM. Thank you very much!

Reviewed-By: Keith Seitz <keiths@redhat.com>

Keith


  reply	other threads:[~2026-07-30 18:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27  9:20 [PATCH 1/2] gdb: simplify code " Tankut Baris Aktemur
2026-07-27  9:20 ` [PATCH 2/2] gdb: preserve lhs type's address spaces/classes " Tankut Baris Aktemur
2026-07-29 17:27 ` [PATCH 1/2] gdb: simplify code " Keith Seitz
2026-07-30  5:47   ` Aktemur, Baris
2026-07-30  9:13 ` [PATCH v2] gdb: prefer lhs type's address spaces/classes " Tankut Baris Aktemur
2026-07-30 18:12   ` Keith Seitz [this message]
2026-08-03  7:57     ` Aktemur, Baris

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=88a0ad4f-e16f-458a-84c6-a0298fad149e@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tankutbaris.aktemur@amd.com \
    --cc=tom@tromey.com \
    /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