From 4626ec44352e5c1d2d50a62b625d035f9c7d35bf Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Tue, 6 Mar 2012 12:35:24 +0000 Subject: [PATCH] note the bug spotted by Tasn. SVN revision: 68824 --- legacy/eina/src/lib/eina_model.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/legacy/eina/src/lib/eina_model.c b/legacy/eina/src/lib/eina_model.c index 51b8079..ae06c1b 100644 --- a/legacy/eina/src/lib/eina_model.c +++ b/legacy/eina/src/lib/eina_model.c @@ -522,6 +522,27 @@ _eina_model_interface_implements(const Eina_Model_Interface *iface, const Eina_M } /* apply topological sort and remove duplicates */ +/* + * TODO: Topological sort will only work for linked interfaces, but + * will ignore original ordering provided by types. Consider the + * following: + * + * - A_Type -> X_Iface (name: "MyIface") + * - B_Type -> Y_Iface (name: "MyIface") + * + * Both X_Iface and Y_Iface are different implementations of the + * "MyIface". + * + * B_Type inherits from A_Type, then Y_Iface must be looked up + * first, even though there is no link between Y_Iface and + * X_Iface. + * + * However, the way the current topological sort behaves, the + * roots may come out in any order. We need a stable version + * that sorts roots before removing them from graph. + * + * Thanks to Tasn to report it :-) + */ static Eina_Bool _eina_model_description_ifaces_fix(Eina_Model_Description *desc) { @@ -589,6 +610,11 @@ _eina_model_description_ifaces_fix(Eina_Model_Description *desc) { struct node *r, *d; + /* TODO: sort roots using input order? Or at least study if + * it's enough to change roots append to prepend. + * + * See comments above. + */ n_roots--; r = roots[n_roots]; -- 2.7.4