#803: PCT emits bogus code for getattribute on named register variable
-----------------------------+----------------------------------------------
 Reporter:  Austin_Hastings  |       Owner:  pmichaud                   
     Type:  bug              |      Status:  assigned                   
 Priority:  normal           |   Milestone:                             
Component:  PCT              |     Version:  1.3.0                      
 Severity:  high             |    Keywords:  PCT, register, getattribute
     Lang:                   |       Patch:                             
 Platform:                   |  
-----------------------------+----------------------------------------------
Changes (by pmichaud):

  * status:  new => assigned


Comment:

 Now fixed in r39895.  Here's the NQP program I used to test and verify it:

 {{{
 $ cat x.nqp
 Q:PIR { load_bytecode 'PCT.pbc' };

 # build simple PAST tree to test
 my $block := PAST::Block.new();
 $block.push(
     PAST::Var.new(
         :name("someAttr"),
         :scope("attribute"),
         PAST::Var.new( :name('Global'), :scope('package') )
     )
 );
 $block.push(
     PAST::Var.new(
         :name("someAttr"),
         :scope("attribute"),
         PAST::Var.new( :name('myreg'), :scope('register') )
     )
 );

 my $str := PAST::Compiler.compile($block, :target('pir'));
 say($str);
 $ ./parrot nqp.pbc x.nqp

 .namespace []
 .sub "_block30"  :anon :subid("15_1246853334")
 .annotate "line", 0
     get_global $P32, "Global"
     getattribute $P33, $P32, "someAttr"
     getattribute $P34, myreg, "someAttr"
     .return ($P34)
 .end

 $
 }}}

 Thanks!

 Pm

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