diff options
author | Andrew Cagney <cagney@redhat.com> | 2001-03-19 20:08:16 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2001-03-19 20:08:16 +0000 |
commit | 0b3f98d3508f6b8ed8a9fe14e3c3727ac2ea0d69 (patch) | |
tree | e34b7fb5064effeb187b9ac38611512a2e8d5052 /gdb/valops.c | |
parent | 7451d027679bb07d31ddb8d0359d62b0226ffc71 (diff) | |
download | gdb-0b3f98d3508f6b8ed8a9fe14e3c3727ac2ea0d69.zip gdb-0b3f98d3508f6b8ed8a9fe14e3c3727ac2ea0d69.tar.gz gdb-0b3f98d3508f6b8ed8a9fe14e3c3727ac2ea0d69.tar.bz2 |
* valops.c (hand_function_call): Simplify computation of the
address of the pushed argument.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index d417cdc..0ab0ae6 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1530,26 +1530,19 @@ You must use a pointer to function type variable. Command ignored.", arg_name); { /* stack grows downward */ sp -= aligned_len; + /* ... so the address of the thing we push is the + stack pointer after we push it. */ + addr = sp; } else { /* The stack grows up, so the address of the thing we push is the stack pointer before we push it. */ addr = sp; - } - /* Push the structure. */ - write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len); - if (INNER_THAN (1, 2)) - { - /* The stack grows down, so the address of the thing - we push is the stack pointer after we push it. */ - addr = sp; - } - else - { - /* stack grows upward */ sp += aligned_len; } + /* Push the structure. */ + write_memory (addr, VALUE_CONTENTS_ALL (args[i]), len); /* The value we're going to pass is the address of the thing we just pushed. */ /*args[i] = value_from_longest (lookup_pointer_type (value_type), |