public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Alan Hayward <alan.hayward@arm.com>, gdb-patches@sourceware.org
Cc: nd@arm.com
Subject: Re: [PATCH v3 2/3] Pass return_method to _push_dummy_call
Date: Fri, 19 Oct 2018 11:31:00 -0000	[thread overview]
Message-ID: <d15502fb-a8b5-88e1-9bdc-f741d66261b2@redhat.com> (raw)
In-Reply-To: <20181011144905.66908-3-alan.hayward@arm.com>

On 10/11/2018 03:49 PM, Alan Hayward wrote:
>    /* First determine how much stack space we will need.  */
> -  for (i = 0, argreg = E_1ST_ARGREG + (struct_return != 0); i < nargs; i++)
> +  for (i = 0, argreg = E_1ST_ARGREG + (return_method == return_method_struct);
> +       i < nargs; i++)

Please write:

  for (i = 0, argreg = E_1ST_ARGREG + (return_method == return_method_struct);
       i < nargs; 
       i++)

I.e., once you have to break one the statements, it reads better to break
them all.

> @@ -238,7 +239,7 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch,
>  
>    /* If struct_return is true, then the struct return address will
>       consume one argument-passing register.  */

This comment needs a slight update.

> -  if (struct_return)
> +  if (return_method == return_method_struct)


> @@ -1577,7 +1578,7 @@ aarch64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
>      }
>  
>    /* The struct_return pointer occupies X8.  */
> -  if (struct_return || lang_struct_return)
> +  if (return_method != return_method_normal)
>      {

I think in this patch, this should still read:

  if (return_method == return_method_struct || lang_struct_return)

So that the patch has no side effects other than passing the
return_method down.

Thanks,
Pedro Alves

  reply	other threads:[~2018-10-19 11:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 14:49 [PATCH v3 0/3] Aarch64: Fix segfault when casting dummy calls Alan Hayward
2018-10-11 14:49 ` [PATCH v3 1/3] Use enum for return method for " Alan Hayward
2018-10-19 11:28   ` Pedro Alves
2018-10-11 14:49 ` [PATCH v3 2/3] Pass return_method to _push_dummy_call Alan Hayward
2018-10-19 11:31   ` Pedro Alves [this message]
2018-10-11 14:49 ` [PATCH v3 3/3] Aarch64: Fix segfault when casting dummy calls Alan Hayward
2018-10-19 11:36   ` Pedro Alves
2018-10-23 16:08     ` Alan Hayward
2018-10-24 15:15       ` Pedro Alves
2018-10-29 11:58         ` Alan Hayward
2018-10-29 12:38           ` Pedro Alves
2018-10-29 14:56             ` Alan Hayward
2018-10-29 18:13               ` Pedro Alves
2018-10-30 11:13                 ` Alan Hayward
2018-10-30 16:31                   ` Pedro Alves
2018-10-30 17:09                     ` Alan Hayward
2018-10-30 17:40                       ` Pedro Alves
2018-10-18  9:50 ` [PING][PATCH v3 0/3] " Alan Hayward

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=d15502fb-a8b5-88e1-9bdc-f741d66261b2@redhat.com \
    --to=palves@redhat.com \
    --cc=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).