summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-09-12 09:49:14 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-09-12 09:49:14 (GMT)
commitdfe76faf21e254c02c86a1b0b1f8ca8fc07fe027 (patch)
treec760a6b8f5df595b6beaff1548f513511e8a3140 /tools
parenteb8896aed68fbacf87a2c530fcd584b71da2c222 (diff)
Noted a special attention to a potential special case.
Diffstat (limited to 'tools')
-rw-r--r--tools/d2c/conv/manager.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/tools/d2c/conv/manager.c b/tools/d2c/conv/manager.c
index f664beb..aae69c2 100644
--- a/tools/d2c/conv/manager.c
+++ b/tools/d2c/conv/manager.c
@@ -452,8 +452,39 @@ bool define_conv_func(conv_func *func, int fd, const coding_bits *bits, const co
*/
if (func->defined)
{
- // TODO : faire un object_ref() si c'est un objet
- //assert(0);
+ /**
+ * La question de la propriété d'un opérande se pose si un opérande
+ * est partagé entre plusieurs propriétaires.
+ *
+ * Le second usage de cet opérande, détecté ici, doit conduire à
+ * une incrémentation de son compteur de références, via un appel à
+ * g_object_ref(), si une instance GObject est manipulée.
+ *
+ * Or ce n'est jusqu'à présent jamais le cas. Les doubles usages sont
+ * issus de constructions via les fonctions suivantes :
+ *
+ * - UInt ;
+ * - SingleWordVector ;
+ * - DoubleWordVector.
+ *
+ * La mise en place d'une incrémentation des objets est donc reportée
+ * au moment où elle sera utile.
+ */
+
+#ifndef NDEBUG
+
+ if (!func->is_expr)
+ {
+ if (strcmp(func->name, "UInt") != 0
+ && strcmp(func->name, "SingleWordVector") != 0
+ && strcmp(func->name, "DoubleWordVector") != 0)
+ {
+ assert(false);
+ }
+
+ }
+
+#endif
return true;