# New Ticket Created by  Will Coleda 
# Please include the string:  [perl #50398]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=50398 >


The recent PCCMETHOD -> METHOD update in the pdd17pmc branch breaks
tcl, since there is a lone METHOD there.

The following naive patch fixes up the syntax...

Index: src/pmc/tclstring.pmc
===================================================================
--- src/pmc/tclstring.pmc       (revision 25358)
+++ src/pmc/tclstring.pmc       (working copy)
@@ -19,7 +19,7 @@
     maps    String
 {

-    METHOD PMC* get_list(STRING* str) {
+    METHOD get_list(STRING* str) {
         PMC*   retval = pmc_new(INTERP, pmc_type(INTERP, string_from_literal(IN
TERP, "TclList")));
         INTVAL pos = -1; /* we're going to increment before we use it... */
         INTVAL len;
@@ -27,7 +27,9 @@
         PMC* P0;
         STRING* S0;

-        if (! str) return SELF;
+        if (! str) {
+             PCCRETURN(PMC *SELF);
+        }
         /*
          * RT#48166 This prevents a segfault; retval gets claimed before it
          * it is used below without this register. This shouldn't happen
@@ -166,7 +168,7 @@

       done:
         Parrot_unregister_pmc(INTERP, retval);
-        return retval;
+        PCCRETURN(PMC *retval);
     }
 }

But then fails at runtime:

% ../../parrot tcl.pbc

unable to assign self to this type
current instr.: '__list' pc 25992 (languages/tcl/runtime/conversions.pir:27)
called from Sub '&proc' pc 19294 (languages/tcl/runtime/builtin/proc.pir:106)
called from Sub '_anon' pc 44 (EVAL_4:18)
called from Sub '__load_stdlib' pc 56134 (runtime/tcllib.pir:291)
called from Sub '_main' pc 3 (src/tclsh.pir:36)

Tracing the assign on that line in conversions.pir gives:

 25994 assign P0, P1                    P0=Undef=PMC(0x2f1c398)
P1=TclList=PMC(0x2f1ae7c)
unable to assign self to this type

So, it looks like the get_list call worked (based on the type of P1
and earlier PIR in that file), but that the real issue here is that
assign isn't working.

-- 
Will "Coke" Coleda

Reply via email to