#385: t/pmc/packfileconstanttable.t failure
--------------------+-------------------------------------------------------
 Reporter:  coke    |       Owner:  Infinoid
     Type:  bug     |      Status:  new     
 Priority:  normal  |   Milestone:          
Component:  none    |     Version:          
 Severity:  medium  |    Keywords:          
     Lang:          |       Patch:          
 Platform:          |  
--------------------+-------------------------------------------------------

Comment(by rg):

 Replying to [comment:10 Infinoid]:

 > Yep.  PDD13 says it will throw an exception if the constant at the given
 offset isn't of the requested type, so autoconverting would be wrong.

 Not quite. Here's the description for the failing case:

 {{{
 =item * C<get_pmc_keyed_int> (v-table)

 Gets the value of the PMC or key constant at the specified index in the
 constants table. If the constant at that position in the table is not a
 PMC
 or key, an exception will be thrown.
 }}}

 >  So I think the PackfileConstantTable class is doing the right thing
 here.

 I think it's missing the "or key constant" part. The failing case is the
 one accessing the key constant, but the lvalue, being a PMC, is not
 accepted as the right type. Since there is no such thing as a "key"
 register, autoconverting (if that's even necessary) is the only
 possibility.

 > To fix this properly, the test should use a pbc file whose contents are
 known (and guaranteed to never change).  It should probably generate this
 pbc file itself.

 I think this is exactly what the test was supposed to check. And while I
 agree that a pbc file whose contents are known '''to fully exercise the
 test and api''' would be preferable, it should at least work with any pbc
 file.

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