#728: r39273 breaks 'make test' for tcl
--------------------+-------------------------------------------------------
 Reporter:  coke    |       Owner:  bacek      
     Type:  bug     |      Status:  new        
 Priority:  normal  |   Milestone:  1.3        
Component:  none    |     Version:  trunk      
 Severity:  medium  |    Keywords:  tcl blocker
     Lang:          |       Patch:             
 Platform:          |  
--------------------+-------------------------------------------------------

Comment(by bacek):

 Replying to [ticket:728 coke]:
 > As of r39273, partcl's 'prove t/tcl_misc.t' fails some tests.
 >
 > the transformations in src/grammar/expr/past2pir.tg begins to generate
 invalid code.

 Ok... There is two versions which fix this ticket:

 {{{
 diff --git a/src/pmc.c b/src/pmc.c
 index 506aa05..a81559a 100644
 --- a/src/pmc.c
 +++ b/src/pmc.c
 @@ -258,9 +258,13 @@ Parrot_pmc_try_reuse(PARROT_INTERP, ARGIN(PMC *self),
 ARGIN
      if (dest->vtable->flags & VTABLE_IS_READONLY_FLAG)
          return pmc_new(interp, VTABLE_type(interp, self));

 -    /* It's safe in this case. Caller want to replace us anyway */
 +    /*
 +       It's NOT safe in this case.
 +       Caller want to replace us but calls to C<self> and C<dest> can be
 mixed.
 +       See TT#728 for reference.
 +    */
      if (dest == self)
 -        return dest;
 +        return pmc_new(interp, VTABLE_type(interp, self));

      /* Morph to self type is required */
      {
 }}}

 and

 {{{
 ba...@icering:~/src/parrot$ git diff src/pmc/
 diff --git a/src/pmc/scalar.pmc b/src/pmc/scalar.pmc
 index 70b591a..600b9f5 100644
 --- a/src/pmc/scalar.pmc
 +++ b/src/pmc/scalar.pmc
 @@ -1069,7 +1069,7 @@ Concatenate the string C<value> in place.
          STRING * const s = Parrot_str_concat(INTERP,
              SELF.get_string(), value, 0);

 -        dest = Parrot_pmc_try_reuse(INTERP, SELF, NULL, dest);
 +        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));

          VTABLE_set_string_native(INTERP, dest, s);
          return dest;
 }}}

 I can understand why former is better, but epically fail to understand why
 latter fix problem too...

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/728#comment:3>
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