[RFA,03/13] Use a previously unused variable in bfin-tdep.c

Message ID 20180712205208.32646-4-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey July 12, 2018, 8:51 p.m. UTC
  This changes bfin_push_dummy_call to use the result of check_typedef.
Calling check_typedef for effect was probably ok as well, but this
seemed a little nicer.

gdb/ChangeLog
2018-07-12  Tom Tromey  <tom@tromey.com>

	* bfin-tdep.c (bfin_push_dummy_call): Use arg_type, not
	value_type.
---
 gdb/ChangeLog   | 5 +++++
 gdb/bfin-tdep.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
  

Comments

Simon Marchi July 14, 2018, 1:17 a.m. UTC | #1
On 2018-07-12 04:51 PM, Tom Tromey wrote:
> This changes bfin_push_dummy_call to use the result of check_typedef.
> Calling check_typedef for effect was probably ok as well, but this
> seemed a little nicer.

LGTM.

Simon
  

Patch

diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
index da62130231b..c84625c8948 100644
--- a/gdb/bfin-tdep.c
+++ b/gdb/bfin-tdep.c
@@ -526,7 +526,7 @@  bfin_push_dummy_call (struct gdbarch *gdbarch,
     {
       struct type *value_type = value_enclosing_type (args[i]);
       struct type *arg_type = check_typedef (value_type);
-      int container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
+      int container_len = (TYPE_LENGTH (arg_type) + 3) & ~3;
 
       sp -= container_len;
       write_memory (sp, value_contents (args[i]), container_len);