From e47f68925ea39c2edea07725acb01ce24243ad9b Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 20 Aug 2008 19:01:20 +0000 Subject: [PATCH] Avoid alias infloops. 2008-08-20 Colin Walters * girepository/girparser.c: Avoid alias infloops. svn path=/trunk/; revision=420 --- girparser.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/girparser.c b/girparser.c index a4581e6c7..f15e3c1f4 100644 --- a/girparser.c +++ b/girparser.c @@ -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; }