[svn:parrot] r41183 - trunk/src/pmc

NotFound at svn.parrot.org NotFound at svn.parrot.org
Thu Sep 10 21:15:26 UTC 2009


Author: NotFound
Date: Thu Sep 10 21:15:25 2009
New Revision: 41183
URL: https://trac.parrot.org/parrot/changeset/41183

Log:
[pmc] Workaround for FixedPMCArray sort method, TT #218

Modified:
   trunk/src/pmc/fixedpmcarray.pmc

Modified: trunk/src/pmc/fixedpmcarray.pmc
==============================================================================
--- trunk/src/pmc/fixedpmcarray.pmc	Thu Sep 10 21:02:26 2009	(r41182)
+++ trunk/src/pmc/fixedpmcarray.pmc	Thu Sep 10 21:15:25 2009	(r41183)
@@ -44,8 +44,15 @@
     METHOD sort(PMC *cmp_func :optional) {
         const INTVAL n = SELF.elements();
 
-        if (n > 1)
-           Parrot_quicksort(interp, (void **)PMC_array(SELF), n, cmp_func);
+        if (n > 1) {
+           /* XXX Workaround for TT #218 */
+           if (PObj_is_object_TEST(SELF)) {
+              PMC *parent = SELF.get_attr_str(CONST_STRING(interp, "proxy"));
+              Parrot_pcc_invoke_method_from_c_args(interp, parent, CONST_STRING(interp, "sort"), "P->", cmp_func);
+           }
+           else
+               Parrot_quicksort(interp, (void **)PMC_array(SELF), n, cmp_func);
+        }
     }
 
 /*


More information about the parrot-commits mailing list