* valops.c (hand_function_call): Simplify computation of the
authorAndrew Cagney <cagney@redhat.com>
Mon, 19 Mar 2001 20:08:16 +0000 (20:08 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 19 Mar 2001 20:08:16 +0000 (20:08 +0000)
address of the pushed argument.

gdb/ChangeLog
gdb/valops.c

index c0f110fa2278daf52277d699ad01fad8e73efd56..4490a2afce7ca76cf3485ad12cf1a2ca05eb24f5 100644 (file)
@@ -1,3 +1,9 @@
+2001-03-19  Andrew Cagney  <ac131313@redhat.com>
+
+       From Mon Nov 20 13:59:29 2000 Andrew Cagney <cagney@b1.cygnus.com>:
+       * valops.c (hand_function_call): Simplify computation of the
+       address of the pushed argument.
 2001-03-17  Andrew Cagney  <ac131313@redhat.com>
 
        * p-exp.y (parse_number): Avoid shift overflow when ``long''.
index d417cdc2a0658d2417afa4fd1fd012276920ba98..0ab0ae6e916a97c4c82eb361a3e22813a54b6058 100644 (file)
@@ -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),