public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@seketeli.org>
To: Xiaole He via Libabigail <libabigail@sourceware.org>
Cc: Xiaole He <hexiaole1994@126.com>,  Xiaole He <hexiaole@kylinos.cn>
Subject: Re: [PATCH] abg-ir: add missing else
Date: Mon, 17 Oct 2022 16:13:45 +0200	[thread overview]
Message-ID: <87pmeqr10m.fsf@seketeli.org> (raw)
In-Reply-To: <20221016042642.37944-1-hexiaole1994@126.com> (Xiaole He via Libabigail's message of "Sun, 16 Oct 2022 04:26:42 +0000")

Hello Xiaole,

Xiaole He via Libabigail <libabigail@sourceware.org> a écrit:

> From: Xiaole He <hexiaole@kylinos.cn>
>
> In 'bind_function_type_life_time' function of 'src/abg-ir.cc', the code
> obtains the member 'const environment*' of 'class function_type', that
> is, the 'e' variable in below code. And assure the obtained
> 'environment*' is same as the 'const environment*' of the
> 'class translation_unit', that is, the'env' variable in below code:
>
> /* src/abg-ir.cc begin */
> 1  void
> 2  translation_unit::bind_function_type_life_time(function_type_sptr ftype)
> 3  {
> 4    ...
> 5    const environment* env = get_environment();
> 6    ...
> 7    if (const environment* e = ftype->get_environment())
> 8      ABG_ASSERT(env == e);
> 9    ftype->set_environment(const_cast<environment*>(env));
> 10
> 11   if (const translation_unit* existing_tu = ftype->get_translation_unit())
> 12     ABG_ASSERT(existing_tu == this);
> 13   else
> 14     ftype->set_translation_unit(const_cast<translation_unit*>(this));
> 15    ...
> /* src/abg-ir.cc end */
>
> There was a missing 'else' between the 'line 8' and line 9', as the
> explicit 'else' at the 'line 13'. Without the 'else' between the
> 'line 8' and line 9', there will be a redundant assignment at 'line 9'
> under the condition when the 'env' is equal to 'e'.
> This patch add the missing 'else' between the 'line 8' and 'line 9'.
>
>         * src/abg-ir.cc (bind_function_type_life_time): add missing
>         else
>
> Signed-off-by: Xiaole He <hexiaole@kylinos.cn>
> Tested-by: Xiaole He <hexiaole@kylinos.cn>

Applied to the master branch.  Thanks!

[...]

Cheers,

-- 
		Dodji

  reply	other threads:[~2022-10-17 14:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16  4:26 Xiaole He
2022-10-17 14:13 ` Dodji Seketeli [this message]
2022-10-18  3:24   ` Xiaole He

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=87pmeqr10m.fsf@seketeli.org \
    --to=dodji@seketeli.org \
    --cc=hexiaole1994@126.com \
    --cc=hexiaole@kylinos.cn \
    --cc=libabigail@sourceware.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).