*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / valops.c
index 2ed99235a969c51e411e2771a0505d2b0fc1353f..3db7341df6e3e6fc22cdedc52fd71402daaa504e 100644 (file)
@@ -697,6 +697,7 @@ value_assign (struct value *toval, struct value *fromval)
        int amount_copied;
 
        /* Make the buffer large enough in all cases.  */
+       /* FIXME (alloca): Not safe for very large data types. */
        char *buffer = (char *) alloca (amount_to_copy
                                        + sizeof (LONGEST)
                                        + MAX_REGISTER_RAW_SIZE);
@@ -1077,10 +1078,6 @@ value_push (register CORE_ADDR sp, struct value *arg)
   return sp;
 }
 
-#ifndef PUSH_ARGUMENTS
-#define PUSH_ARGUMENTS default_push_arguments
-#endif
-
 CORE_ADDR
 default_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
                        int struct_return, CORE_ADDR struct_addr)
@@ -1142,16 +1139,18 @@ standard_coerce_float_to_double (struct type *formal, struct type *actual)
    IS_PROTOTYPED is non-zero if the function declaration is prototyped.  */
 
 static struct value *
-value_arg_coerce (struct value *arg, struct type *param_type, int is_prototyped)
+value_arg_coerce (struct value *arg, struct type *param_type,
+                 int is_prototyped)
 {
   register struct type *arg_type = check_typedef (VALUE_TYPE (arg));
   register struct type *type
-  = param_type ? check_typedef (param_type) : arg_type;
+    = param_type ? check_typedef (param_type) : arg_type;
 
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_REF:
-      if (TYPE_CODE (arg_type) != TYPE_CODE_REF)
+      if (TYPE_CODE (arg_type) != TYPE_CODE_REF
+         && TYPE_CODE (arg_type) != TYPE_CODE_PTR)
        {
          arg = value_addr (arg);
          VALUE_TYPE (arg) = param_type;
@@ -2272,23 +2271,32 @@ search_struct_method (char *name, struct value **arg1p,
 
          if (j > 0 && args == 0)
            error ("cannot resolve overloaded method `%s': no arguments supplied", name);
-         while (j >= 0)
+         else if (j == 0 && args == 0)
            {
              if (TYPE_FN_FIELD_STUB (f, j))
                check_stub_method (type, i, j);
-             if (!typecmp (TYPE_FN_FIELD_STATIC_P (f, j),
-                           TYPE_FN_FIELD_ARGS (f, j), args))
-               {
-                 if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
-                   return value_virtual_fn_field (arg1p, f, j, type, offset);
-                 if (TYPE_FN_FIELD_STATIC_P (f, j) && static_memfuncp)
-                   *static_memfuncp = 1;
-                 v = value_fn_field (arg1p, f, j, type, offset);
-                 if (v != NULL)
-                   return v;       
-               }
-             j--;
+             v = value_fn_field (arg1p, f, j, type, offset);
+             if (v != NULL)
+               return v;
            }
+         else
+           while (j >= 0)
+             {
+               if (TYPE_FN_FIELD_STUB (f, j))
+                 check_stub_method (type, i, j);
+               if (!typecmp (TYPE_FN_FIELD_STATIC_P (f, j),
+                             TYPE_FN_FIELD_ARGS (f, j), args))
+                 {
+                   if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
+                     return value_virtual_fn_field (arg1p, f, j, type, offset);
+                   if (TYPE_FN_FIELD_STATIC_P (f, j) && static_memfuncp)
+                     *static_memfuncp = 1;
+                   v = value_fn_field (arg1p, f, j, type, offset);
+                   if (v != NULL)
+                     return v;       
+                 }
+               j--;
+             }
        }
     }
 
@@ -3242,7 +3250,7 @@ value_of_this (int complain)
 
   /* Calling lookup_block_symbol is necessary to get the LOC_REGISTER
      symbol instead of the LOC_ARG one (if both exist).  */
-  sym = lookup_block_symbol (b, funny_this, VAR_NAMESPACE);
+  sym = lookup_block_symbol (b, funny_this, NULL, VAR_NAMESPACE);
   if (sym == NULL)
     {
       if (complain)
This page took 0.024643 seconds and 4 git commands to generate.