#1826: custom cmp kills FixedIntegerArray::sort
--------------------+-------------------------------------------------------
 Reporter:  cotto   |       Owner:       
     Type:  bug     |      Status:  new  
 Priority:  normal  |   Milestone:       
Component:  none    |     Version:  2.8.0
 Severity:  medium  |    Keywords:       
     Lang:          |       Patch:       
 Platform:          |  
--------------------+-------------------------------------------------------
 Passing a custom comparison sub to FixedIntegerArray's sort method causes
 a segfault in code that works as expected with FixedPMCArray.  The only
 difference between the two scripts below is the type of $P0.


 {{{
 co...@feather:/usr/src/parrot/parrot-svn-committable\ 1 $ cat inner.pir
 .sub main :main
     $P0 = new ['FixedPMCArray']
     $P0 = 3
     $P0[0] = 1
     $P0[1] = 3
     $P0[2] = 3
     $P1 = get_global 'sorter'
     $P0.'sort'($P1)
 .end

 .sub sorter
     .param pmc a
     .param pmc b
     say "sort"

     .return (a)
 .end


 co...@feather:/usr/src/parrot/parrot-svn-committable\ 1 $ ./parrot
 inner.pir
 sort
 sort
 sort
 co...@feather:/usr/src/parrot/parrot-svn-committable\ 1 $ cat inner.pir
 .sub main :main
     $P0 = new ['FixedIntegerArray']
     $P0 = 3
     $P0[0] = 1
     $P0[1] = 3
     $P0[2] = 3
     $P1 = get_global 'sorter'
     $P0.'sort'($P1)
 .end

 .sub sorter
     .param pmc a
     .param pmc b
     say "sort"

     .return (a)
 .end


 co...@feather:/usr/src/parrot/parrot-svn-committable\ 1 $ ./parrot
 inner.pir
 Segmentation fault
 }}}

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/1826>
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