#773: Can't override vtables of a PMC from PIR
-----------------------+----------------------------------------------------
  Reporter:  coke      |        Type:  bug    
    Status:  reopened  |    Priority:  blocker
 Milestone:            |   Component:  core   
   Version:  1.2.0     |    Severity:  medium 
Resolution:            |    Keywords:         
      Lang:  tcl       |       Patch:         
  Platform:            |  
-----------------------+----------------------------------------------------
Changes (by coke):

  * status:  closed => reopened
  * resolution:  wontfix =>


Comment:

 If you define the (dynamic) PMC, how can you override the class? The
 following example, cribbed from Object's "name":

 {{{
     VTABLE INTVAL get_bool() {
         PMC    * const _class     = VTABLE_get_class(interp, SELF);
         STRING * const get_bool   = CONST_STRING(interp, "get_bool");

         /* Get the vtable override for 'get_bool', run that instead. */
         PMC * const method = Parrot_oo_find_vtable_override(interp,
 _class, get_bool);

         if (!PMC_IS_NULL(method))
             return (INTVAL)Parrot_run_meth_fromc_args(interp, method,
 SELF, get_bool, "");
         else
             return -9999; // This should never happen.

      }
 }}}

 Compiles, but dies at runtime (OS X) with:

 {{{
 dyld: lazy symbol binding failed: Symbol not found:
 _Parrot_oo_find_vtable_override
   Referenced from: dynext/tcl_group.bundle
 }}}

 Looks like that method needs to be marked PARROT_EXPORT for this to work.

 I'll test it when I fix 'make install' on my OS X box.

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/773#comment:7>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to