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:
Colin Walters 2008-08-20 19:01:20 +00:00 committed by Colin Walters
parent abcebee79f
commit e47f68925e

View File

@ -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;
}