mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
Avoid alias infloops.
2008-08-20 Colin Walters <walters@verbum.org> * girepository/girparser.c: Avoid alias infloops. svn path=/trunk/; revision=420
This commit is contained in:
parent
abcebee79f
commit
e47f68925e
@ -435,11 +435,16 @@ resolve_aliases (ParseContext *ctx, const gchar *type)
|
||||
{
|
||||
gpointer orig;
|
||||
gpointer value;
|
||||
GSList *seen_values = NULL;
|
||||
|
||||
seen_values = g_slist_prepend (seen_values, type);
|
||||
while (g_hash_table_lookup_extended (ctx->aliases, type, &orig, &value))
|
||||
{
|
||||
g_debug ("Resolved: %s => %s", type, value);
|
||||
type = value;
|
||||
if (g_slist_find_custom (seen_values, type, strcmp) != NULL)
|
||||
break;
|
||||
seen_values = g_slist_prepend (seen_values, type);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user