On OS X to use perl's malloc need to USE_PERL_SBRK and emulate sbrk()
[p5sagit/p5-mst-13.2.git] / pp_ctl.c
index 94a3f31..d0e2ef6 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -371,7 +371,14 @@ Perl_rxres_free(pTHX_ void **rsp)
     UV *p = (UV*)*rsp;
 
     if (p) {
+#ifdef PERL_POISON
+       void *tmp = INT2PTR(char*,*p);
+       Safefree(tmp);
+       if (*p)
+           Poison(*p, 1, sizeof(*p));
+#else
        Safefree(INT2PTR(char*,*p));
+#endif
 #ifdef PERL_OLD_COPY_ON_WRITE
        if (p[1]) {
            SvREFCNT_dec (INT2PTR(SV*,p[1]));
@@ -1374,6 +1381,7 @@ Perl_dounwind(pTHX_ I32 cxix)
        }
        cxstack_ix--;
     }
+    PERL_UNUSED_VAR(optype);
 }
 
 void
@@ -2053,6 +2061,7 @@ PP(pp_last)
     PMOP *newpm;
     SV **mark;
     SV *sv = Nullsv;
+    PERL_UNUSED_VAR(optype);
 
     if (PL_op->op_flags & OPf_SPECIAL) {
        cxix = dopoptoloop(cxstack_ix);
@@ -2068,6 +2077,7 @@ PP(pp_last)
        dounwind(cxix);
 
     POPBLOCK(cx,newpm);
+    PERL_UNUSED_VAR(optype);
     cxstack_ix++; /* temporarily protect top context */
     mark = newsp;
     switch (CxTYPE(cx)) {
@@ -2380,6 +2390,9 @@ PP(pp_goto)
                    PUSHMARK(mark);
                    PUTBACK;
                    (void)(*CvXSUB(cv))(aTHX_ cv);
+                   /* Put these at the bottom since the vars are set but not used */
+                   PERL_UNUSED_VAR(newsp);
+                   PERL_UNUSED_VAR(gimme);
                }
                LEAVE;
                return retop;
@@ -2857,7 +2870,7 @@ Perl_find_runcv(pTHX_ U32 *db_seqp)
        for (ix = si->si_cxix; ix >= 0; ix--) {
            const PERL_CONTEXT *cx = &(si->si_cxstack[ix]);
            if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
-               CV *cv = cx->blk_sub.cv;
+               CV * const cv = cx->blk_sub.cv;
                /* skip DB:: code */
                if (db_seqp && PL_debstash && CvSTASH(cv) == PL_debstash) {
                    *db_seqp = cx->blk_oldcop->cop_seq;