[svn:parrot] r41261 - trunk/src/call

NotFound at svn.parrot.org NotFound at svn.parrot.org
Mon Sep 14 15:52:10 UTC 2009


Author: NotFound
Date: Mon Sep 14 15:52:07 2009
New Revision: 41261
URL: https://trac.parrot.org/parrot/changeset/41261

Log:
[core] handle some corner cases in pcc retval settings, avoid some segfaults

Modified:
   trunk/src/call/ops.c
   trunk/src/call/pcc.c

Modified: trunk/src/call/ops.c
==============================================================================
--- trunk/src/call/ops.c	Mon Sep 14 11:59:59 2009	(r41260)
+++ trunk/src/call/ops.c	Mon Sep 14 15:52:07 2009	(r41261)
@@ -338,7 +338,7 @@
     ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
     va_end(args);
     retval = (PMC *)set_retval(interp, *sig, ctx);
-    return retval;
+    return retval ? retval : PMCNULL;
 }
 
 /*

Modified: trunk/src/call/pcc.c
==============================================================================
--- trunk/src/call/pcc.c	Mon Sep 14 11:59:59 2009	(r41260)
+++ trunk/src/call/pcc.c	Mon Sep 14 15:52:07 2009	(r41261)
@@ -602,6 +602,8 @@
     PMC *sig_pmc = PMCNULL;
 
     if (pc) {
+	if (*pc == 0)
+            return 0;
         ++pc;
         sig_pmc = Parrot_pcc_get_pmc_constant(interp, ctx, *pc);
         ASSERT_SIG_PMC(sig_pmc);


More information about the parrot-commits mailing list