*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / valops.c
index cb302226bb1af194d4c7f1f7372ff373e1d55763..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)
@@ -1152,7 +1149,8 @@ value_arg_coerce (struct value *arg, struct type *param_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;
@@ -2273,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--;
+             }
        }
     }
 
@@ -3243,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.024425 seconds and 4 git commands to generate.