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

jonathan at svn.parrot.org jonathan at svn.parrot.org
Mon Oct 26 19:04:42 UTC 2009


Author: jonathan
Date: Mon Oct 26 19:04:22 2009
New Revision: 42114
URL: https://trac.parrot.org/parrot/changeset/42114

Log:
[core] Eliminate a segfault and fix a regression in get_iter for MultiSub.

Modified:
   trunk/src/pmc/multisub.pmc

Modified: trunk/src/pmc/multisub.pmc
==============================================================================
--- trunk/src/pmc/multisub.pmc	Mon Oct 26 16:29:12 2009	(r42113)
+++ trunk/src/pmc/multisub.pmc	Mon Oct 26 19:04:22 2009	(r42114)
@@ -68,13 +68,16 @@
     }
 
     VTABLE PMC *get_iter() {
+        /* If we have an active signature, we sort the candidates, Otherwise,
+         * just hand back an iterator on however the list is now. */
         PMC * const sig_obj = CONTEXT(interp)->current_sig;
-        PMC * const sub     = Parrot_mmd_sort_manhattan_by_sig_pmc(interp,
-                SELF, sig_obj);
-
-        if (PMC_IS_NULL(sub))
-            Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "No applicable methods.\n");
+        if (!PMC_IS_NULL(sig_obj)) {
+            PMC * const sub     = Parrot_mmd_sort_manhattan_by_sig_pmc(interp,
+                    SELF, sig_obj);
 
+            if (PMC_IS_NULL(sub))
+                Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "No applicable methods.\n");
+        }
         return SUPER();
     }
 


More information about the parrot-commits mailing list