Replace ../include/wait.h with gdb_wait.h.
[deliverable/binutils-gdb.git] / gdb / eval.c
index 30bb04f63d9fc75b625b8feb060b8fd706ea4674..d054ac7ffbd3cfb996d91f01f4d64f5cc156072f 100644 (file)
@@ -59,7 +59,7 @@ static LONGEST
   init_array_element PARAMS ((value_ptr, value_ptr, struct expression *,
                              int *, enum noside, LONGEST, LONGEST));
 
-#ifdef __GNUC__
+#if defined (__GNUC__) && !__STDC__
 inline
 #endif
 static value_ptr
@@ -892,9 +892,12 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
          argvec[1] = arg2;
          argvec[0] = arg1;
        }
-      else
+      else if (op == OP_VAR_VALUE)
        {
          /* Non-member function being called */
+          /* fn: This can only be done for C++ functions.  A C-style function
+             in a C++ program, for instance, does not have the fields that 
+             are expected here */
 
          if (overload_resolution && (exp->language_defn->la_language == language_cplus))
            {
@@ -908,11 +911,11 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
 
              (void) find_overload_match (arg_types, nargs, NULL /* no need for name */ ,
                                 0 /* not method */ , 0 /* strict match */ ,
-                             NULL, exp->elts[5].symbol /* the function */ ,
+                     NULL, exp->elts[save_pos1+2].symbol /* the function */ ,
                                          NULL, &symp, NULL);
 
              /* Now fix the expression being evaluated */
-             exp->elts[5].symbol = symp;
+             exp->elts[save_pos1+2].symbol = symp;
              argvec[0] = evaluate_subexp_with_coercion (exp, &save_pos1, noside);
            }
          else
@@ -921,6 +924,11 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
              /* nothing to be done; argvec already correctly set up */
            }
        }
+      else
+       {
+         /* It is probably a C-style function */
+         /* nothing to be done; argvec already correctly set up */
+       }
 
     do_call_it:
 
This page took 0.024648 seconds and 4 git commands to generate.