mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 15:15:42 +00:00
* cp-support.c (reset_directive_searched): New function.
(make_symbol_overload_list_using): Prevent recursive calls.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2010-06-25 Ulrich Weigand <uweigand@de.ibm.com>
|
||||||
|
|
||||||
|
* cp-support.c (reset_directive_searched): New function.
|
||||||
|
(make_symbol_overload_list_using): Prevent recursive calls.
|
||||||
|
|
||||||
2010-06-25 Phil Muldoon <pmuldoon@redhat.com>
|
2010-06-25 Phil Muldoon <pmuldoon@redhat.com>
|
||||||
|
|
||||||
* printcmd.c (print_variable_and_value): Print error message on
|
* printcmd.c (print_variable_and_value): Print error message on
|
||||||
|
|||||||
@@ -838,6 +838,15 @@ make_symbol_overload_list_adl (struct type **arg_types, int nargs,
|
|||||||
return sym_return_val;
|
return sym_return_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Used for cleanups to reset the "searched" flag in case of an error. */
|
||||||
|
|
||||||
|
static void
|
||||||
|
reset_directive_searched (void *data)
|
||||||
|
{
|
||||||
|
struct using_direct *direct = data;
|
||||||
|
direct->searched = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* This applies the using directives to add namespaces to search in,
|
/* This applies the using directives to add namespaces to search in,
|
||||||
and then searches for overloads in all of those namespaces. It
|
and then searches for overloads in all of those namespaces. It
|
||||||
adds the symbols found to sym_return_val. Arguments are as in
|
adds the symbols found to sym_return_val. Arguments are as in
|
||||||
@@ -847,7 +856,7 @@ static void
|
|||||||
make_symbol_overload_list_using (const char *func_name,
|
make_symbol_overload_list_using (const char *func_name,
|
||||||
const char *namespace)
|
const char *namespace)
|
||||||
{
|
{
|
||||||
const struct using_direct *current;
|
struct using_direct *current;
|
||||||
const struct block *block;
|
const struct block *block;
|
||||||
|
|
||||||
/* First, go through the using directives. If any of them apply,
|
/* First, go through the using directives. If any of them apply,
|
||||||
@@ -861,12 +870,27 @@ make_symbol_overload_list_using (const char *func_name,
|
|||||||
current != NULL;
|
current != NULL;
|
||||||
current = current->next)
|
current = current->next)
|
||||||
{
|
{
|
||||||
|
/* Prevent recursive calls. */
|
||||||
|
if (current->searched)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* If this is a namespace alias or imported declaration ignore it. */
|
/* If this is a namespace alias or imported declaration ignore it. */
|
||||||
if (current->alias != NULL || current->declaration != NULL)
|
if (current->alias != NULL || current->declaration != NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strcmp (namespace, current->import_dest) == 0)
|
if (strcmp (namespace, current->import_dest) == 0)
|
||||||
make_symbol_overload_list_using (func_name, current->import_src);
|
{
|
||||||
|
/* Mark this import as searched so that the recursive call does
|
||||||
|
not search it again. */
|
||||||
|
struct cleanup *old_chain;
|
||||||
|
current->searched = 1;
|
||||||
|
old_chain = make_cleanup (reset_directive_searched, current);
|
||||||
|
|
||||||
|
make_symbol_overload_list_using (func_name, current->import_src);
|
||||||
|
|
||||||
|
current->searched = 0;
|
||||||
|
discard_cleanups (old_chain);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now, add names for this namespace. */
|
/* Now, add names for this namespace. */
|
||||||
|
|||||||
Reference in New Issue
Block a user