[FR] Bug in dynamic inheritance lookup algorithm

Mildred Ki'Lya ml.mildred593 at gmail.com
Thu Apr 1 01:17:32 UTC 2010


Salut,

Je pense avoir trouvé un bug dans l'algo de lookup de parents dans le
cas d'héritage dynamique

Voici ce que j'ai mis en commentaire dans un fichier:

  // Lisaac BUG: with dynamic inheritance. Say we have a prototype SELF
  // inheriting from ROOT. Now, we dynamically change the parent to use
P that
  // is a child of ROOT.
  //
  // When code in P tries to call a slot specific to P (the slot is not
defined
  // in ROOT). Instead of looking at the slot in P, it tries to look at
the slot
  // in SELF, then in ROOT.
  //
  // If the slot is found in SELF, then it is called. That is wrong, it
should
  // call the slot in P instead. The fact is that SELF never redefined
the slot
  // that P tries to call, and it might well do something completely
different
  // than the slot in P does.
  //
  // And if the slot is not found at all, the compiler throws an error.
  //
  // In this section, I define slots that are found in DTA_RD_ARGS and
mark them
  // as deferred. This is to avoid compiler errors.

En pratique, c'est quoi le problème ?

J'ai un type, DTA_DISPATCH_ARGS qui utilise l'héritage dynamique.
En pratique, DTA_DISPATCH_ARGS hérite de DTA_RD est sert d'intermédiaire
entre un utilisateur et une DTA_RD quelconque.

Lorsque je crée un DTA_DISPATCH_ARGS, je lui donne le parent DTA_RD à
utiliser et quelques paramètres qui vont modifier le comportement du DTA_RD.

Le problème survient lorsque je veux utiliser un DTA_RD_ARGS comme
parent de DTA_DISPATCH_ARGS. Le type parent (statique) reste DTA_RD,
mais l'implémentation utilise un objet DTA_RD_ARGS.

Et maintenant, lorsque DTA_RD_ARGS fait un appel interne sur un de ses
slots (par exemple, le slot copy_argument), voilà ce qui se passe:

    * Le type SELF est DTA_DISPATCH_ARGS
    * Donc le compilateur va chercher un slot qui s'appellerait
      copy_argument dans DTA_DISPATCH_ARGS ou un de ses types parents
      (lookup statique)
    * Si le slot copy_argument n'existe que dans DTA_RD_ARGS,
      l'algorithme échour en disant qu'il n'arrive pas à trouver le slot.

Au lieu de cela, ce que le compilateur devrait faire, c'est aller
chercher le slot dans DTA_RD_ARGS.


vous voyez le problème ?


Mildred

-- 
Mildred Ki'Lya
╭───────── mildred593@online.fr ──────────
│ Jabber, GoogleTalk: <mildred at jabber.fr>
│ Website: <http://ki.lya.online.fr>           GPG ID: 9A7D 2E2B
│ Fingerprint: 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 9A7D 2E2B

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/lisaac-devel/attachments/20100401/2c9fc91e/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/lisaac-devel/attachments/20100401/2c9fc91e/attachment-0001.pgp>


More information about the Lisaac-devel mailing list