Change 29947 by [EMAIL PROTECTED] on 2007/01/24 13:54:09

        Integrate:
        [ 27749]
        Subject: [PATCH] Rename variables in some mg_* funcs
        From: [EMAIL PROTECTED] (Andy Lester)
        Date: Sun, 9 Apr 2006 00:20:12 -0500
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 27834]
        Subject: [PATCH] Removed unused var in a macro
        From: [EMAIL PROTECTED] (Andy Lester)
        Date: Sat, 15 Apr 2006 23:32:53 -0500
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 27835]
        Subject: [PATCH] clean up hv_assert()
        From: [EMAIL PROTECTED] (Andy Lester)
        Date: Sat, 15 Apr 2006 23:18:27 -0500
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 27845]
        Subject: [PATCH] dump.c patch redux
        From: [EMAIL PROTECTED] (Andy Lester)
        Date: Sun, 16 Apr 2006 00:29:36 -0500
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 27850]
        Subject: [PATCH] op.c patch, 2nd version
        From: [EMAIL PROTECTED] (Andy Lester)
        Message-ID: <[EMAIL PROTECTED]>
        Date: Fri, 14 Apr 2006 23:29:24 -0500
        
        [ 27860]
        Subject: [PATCH] pp_ctl.c caching
        From: [EMAIL PROTECTED] (Andy Lester)
        Message-ID: <[EMAIL PROTECTED]>
        Date: Sun, 16 Apr 2006 23:40:35 -0500

Affected files ...

... //depot/maint-5.8/perl/dump.c#64 integrate
... //depot/maint-5.8/perl/embed.fnc#181 integrate
... //depot/maint-5.8/perl/embed.h#136 integrate
... //depot/maint-5.8/perl/hv.c#102 integrate
... //depot/maint-5.8/perl/mg.c#132 integrate
... //depot/maint-5.8/perl/op.c#170 integrate
... //depot/maint-5.8/perl/pp_ctl.c#152 integrate
... //depot/maint-5.8/perl/proto.h#170 integrate
... //depot/maint-5.8/perl/thread.h#19 integrate

Differences ...

==== //depot/maint-5.8/perl/dump.c#64 (text) ====
Index: perl/dump.c
--- perl/dump.c#63~29925~       2007-01-22 14:10:59.000000000 -0800
+++ perl/dump.c 2007-01-24 05:54:09.000000000 -0800
@@ -358,33 +358,7 @@
        op_dump(pm->op_pmreplroot);
     }
     if (pm->op_pmflags || (PM_GETRE(pm) && PM_GETRE(pm)->check_substr)) {
-       SV * const tmpsv = newSVpvs("");
-       if (pm->op_pmdynflags & PMdf_USED)
-           sv_catpv(tmpsv, ",USED");
-       if (pm->op_pmdynflags & PMdf_TAINTED)
-           sv_catpv(tmpsv, ",TAINTED");
-       if (pm->op_pmflags & PMf_ONCE)
-           sv_catpv(tmpsv, ",ONCE");
-       if (PM_GETRE(pm) && PM_GETRE(pm)->check_substr
-           && !(PM_GETRE(pm)->reganch & ROPT_NOSCAN))
-           sv_catpv(tmpsv, ",SCANFIRST");
-       if (PM_GETRE(pm) && PM_GETRE(pm)->check_substr
-           && PM_GETRE(pm)->reganch & ROPT_CHECK_ALL)
-           sv_catpv(tmpsv, ",ALL");
-       if (pm->op_pmflags & PMf_SKIPWHITE)
-           sv_catpv(tmpsv, ",SKIPWHITE");
-       if (pm->op_pmflags & PMf_CONST)
-           sv_catpv(tmpsv, ",CONST");
-       if (pm->op_pmflags & PMf_KEEP)
-           sv_catpv(tmpsv, ",KEEP");
-       if (pm->op_pmflags & PMf_GLOBAL)
-           sv_catpv(tmpsv, ",GLOBAL");
-       if (pm->op_pmflags & PMf_CONTINUE)
-           sv_catpv(tmpsv, ",CONTINUE");
-       if (pm->op_pmflags & PMf_RETAINT)
-           sv_catpv(tmpsv, ",RETAINT");
-       if (pm->op_pmflags & PMf_EVAL)
-           sv_catpv(tmpsv, ",EVAL");
+       SV * const tmpsv = pm_description(pm);
        Perl_dump_indent(aTHX_ level, file, "PMFLAGS = (%s)\n", SvCUR(tmpsv) ? 
SvPVX_const(tmpsv) + 1 : "");
        SvREFCNT_dec(tmpsv);
     }
@@ -392,6 +366,44 @@
     Perl_dump_indent(aTHX_ level-1, file, "}\n");
 }
 
+static
+SV *
+S_pm_description(pTHX_ const PMOP *pm)
+{
+    SV * const desc = newSVpvs("");
+    const REGEXP * regex = PM_GETRE(pm);
+    const U32 pmflags = pm->op_pmflags;
+
+    if (pm->op_pmdynflags & PMdf_USED)
+       sv_catpv(desc, ",USED");
+    if (pm->op_pmdynflags & PMdf_TAINTED)
+       sv_catpv(desc, ",TAINTED");
+
+    if (pmflags & PMf_ONCE)
+       sv_catpv(desc, ",ONCE");
+    if (regex && regex->check_substr) {
+       if (!(regex->reganch & ROPT_NOSCAN))
+           sv_catpv(desc, ",SCANFIRST");
+       if (regex->reganch & ROPT_CHECK_ALL)
+           sv_catpv(desc, ",ALL");
+    }
+    if (pmflags & PMf_SKIPWHITE)
+       sv_catpv(desc, ",SKIPWHITE");
+    if (pmflags & PMf_CONST)
+       sv_catpv(desc, ",CONST");
+    if (pmflags & PMf_KEEP)
+       sv_catpv(desc, ",KEEP");
+    if (pmflags & PMf_GLOBAL)
+       sv_catpv(desc, ",GLOBAL");
+    if (pmflags & PMf_CONTINUE)
+       sv_catpv(desc, ",CONTINUE");
+    if (pmflags & PMf_RETAINT)
+       sv_catpv(desc, ",RETAINT");
+    if (pmflags & PMf_EVAL)
+       sv_catpv(desc, ",EVAL");
+    return desc;
+}
+
 void
 Perl_pmop_dump(pTHX_ PMOP *pm)
 {

==== //depot/maint-5.8/perl/embed.fnc#181 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#180~29926~   2007-01-22 14:47:32.000000000 -0800
+++ perl/embed.fnc      2007-01-24 05:54:09.000000000 -0800
@@ -1281,6 +1281,7 @@
 #if defined(PERL_IN_DUMP_C) || defined(PERL_DECL_PROT)
 s      |CV*    |deb_curcv      |I32 ix
 s      |void   |debprof        |NN const OP *o
+s      |SV*    |pm_description |NN const PMOP *pm
 #endif
 
 #if defined(PERL_IN_SCOPE_C) || defined(PERL_DECL_PROT)

==== //depot/maint-5.8/perl/embed.h#136 (text+w) ====
Index: perl/embed.h
--- perl/embed.h#135~29926~     2007-01-22 14:47:32.000000000 -0800
+++ perl/embed.h        2007-01-24 05:54:09.000000000 -0800
@@ -1313,6 +1313,7 @@
 #ifdef PERL_CORE
 #define deb_curcv              S_deb_curcv
 #define debprof                        S_debprof
+#define pm_description         S_pm_description
 #endif
 #endif
 #if defined(PERL_IN_SCOPE_C) || defined(PERL_DECL_PROT)
@@ -3391,6 +3392,7 @@
 #ifdef PERL_CORE
 #define deb_curcv(a)           S_deb_curcv(aTHX_ a)
 #define debprof(a)             S_debprof(aTHX_ a)
+#define pm_description(a)      S_pm_description(aTHX_ a)
 #endif
 #endif
 #if defined(PERL_IN_SCOPE_C) || defined(PERL_DECL_PROT)

==== //depot/maint-5.8/perl/hv.c#102 (text) ====
Index: perl/hv.c
--- perl/hv.c#101~29943~        2007-01-24 04:06:54.000000000 -0800
+++ perl/hv.c   2007-01-24 05:54:09.000000000 -0800
@@ -2106,62 +2106,61 @@
 void
 Perl_hv_assert(pTHX_ HV *hv)
 {
-  HE* entry;
-  int withflags = 0;
-  int placeholders = 0;
-  int real = 0;
-  int bad = 0;
-  I32 riter = HvRITER(hv);
-  HE *eiter = HvEITER(hv);
+    HE* entry;
+    int withflags = 0;
+    int placeholders = 0;
+    int real = 0;
+    int bad = 0;
+    const I32 riter = HvRITER_get(hv);
+    HE *eiter = HvEITER_get(hv);
 
-  (void)hv_iterinit(hv);
+    (void)hv_iterinit(hv);
 
-  while ((entry = hv_iternext_flags(hv, HV_ITERNEXT_WANTPLACEHOLDERS))) {
-    /* sanity check the values */
-    if (HeVAL(entry) == &PL_sv_placeholder) {
-      placeholders++;
-    } else {
-      real++;
+    while ((entry = hv_iternext_flags(hv, HV_ITERNEXT_WANTPLACEHOLDERS))) {
+       /* sanity check the values */
+       if (HeVAL(entry) == &PL_sv_placeholder)
+           placeholders++;
+       else
+           real++;
+       /* sanity check the keys */
+       if (HeSVKEY(entry)) {
+           /*EMPTY*/ /* Don't know what to check on SV keys.  */
+       } else if (HeKUTF8(entry)) {
+           withflags++;
+           if (HeKWASUTF8(entry)) {
+               PerlIO_printf(Perl_debug_log,
+                           "hash key has both WASUFT8 and UTF8: '%.*s'\n",
+                           (int) HeKLEN(entry),  HeKEY(entry));
+               bad = 1;
+           }
+       } else if (HeKWASUTF8(entry))
+           withflags++;
     }
-    /* sanity check the keys */
-    if (HeSVKEY(entry)) {
-      /*EMPTY*/ /* Don't know what to check on SV keys.  */
-    } else if (HeKUTF8(entry)) {
-      withflags++;
-       if (HeKWASUTF8(entry)) {
-        PerlIO_printf(Perl_debug_log,
-                      "hash key has both WASUFT8 and UTF8: '%.*s'\n",
-                      (int) HeKLEN(entry),  HeKEY(entry));
-        bad = 1;
-       }
-    } else if (HeKWASUTF8(entry)) {
-      withflags++;
+    if (!SvTIED_mg((SV*)hv, PERL_MAGIC_tied)) {
+       static const char bad_count[] = "Count %d %s(s), but hash reports %d\n";
+       const int nhashkeys = HvUSEDKEYS(hv);
+       const int nhashplaceholders = HvPLACEHOLDERS_get(hv);
+
+       if (nhashkeys != real) {
+           PerlIO_printf(Perl_debug_log, bad_count, real, "keys", nhashkeys );
+           bad = 1;
+       }
+       if (nhashplaceholders != placeholders) {
+           PerlIO_printf(Perl_debug_log, bad_count, placeholders, 
"placeholder", nhashplaceholders );
+           bad = 1;
+       }
     }
-  }
-  if (!SvTIED_mg((SV*)hv, PERL_MAGIC_tied)) {
-    if (HvUSEDKEYS(hv) != real) {
-      PerlIO_printf(Perl_debug_log, "Count %d key(s), but hash reports %d\n",
-                   (int) real, (int) HvUSEDKEYS(hv));
-      bad = 1;
+    if (withflags && ! HvHASKFLAGS(hv)) {
+       PerlIO_printf(Perl_debug_log,
+                   "Hash has HASKFLAGS off but I count %d key(s) with flags\n",
+                   withflags);
+       bad = 1;
     }
-    if (HvPLACEHOLDERS(hv) != placeholders) {
-      PerlIO_printf(Perl_debug_log,
-                   "Count %d placeholder(s), but hash reports %d\n",
-                   (int) placeholders, (int) HvPLACEHOLDERS(hv));
-      bad = 1;
+    if (bad) {
+       sv_dump((SV *)hv);
     }
-  }
-  if (withflags && ! HvHASKFLAGS(hv)) {
-    PerlIO_printf(Perl_debug_log,
-                 "Hash has HASKFLAGS off but I count %d key(s) with flags\n",
-                 withflags);
-    bad = 1;
-  }
-  if (bad) {
-    sv_dump((SV *)hv);
-  }
-  HvRITER(hv) = riter;         /* Restore hash iterator state */
-  HvEITER(hv) = eiter;
+    HvRITER_set(hv, riter);            /* Restore hash iterator state */
+    HvEITER_set(hv, eiter);
 }
 
 #endif

==== //depot/maint-5.8/perl/mg.c#132 (text) ====
Index: perl/mg.c
--- perl/mg.c#131~29943~        2007-01-24 04:06:54.000000000 -0800
+++ perl/mg.c   2007-01-24 05:54:09.000000000 -0800
@@ -1764,11 +1764,12 @@
 Perl_magic_getpos(pTHX_ SV *sv, MAGIC *mg)
 {
     SV* const lsv = LvTARG(sv);
+    PERL_UNUSED_ARG(mg);
 
     if (SvTYPE(lsv) >= SVt_PVMG && SvMAGIC(lsv)) {
-       mg = mg_find(lsv, PERL_MAGIC_regex_global);
-       if (mg && mg->mg_len >= 0) {
-           I32 i = mg->mg_len;
+       MAGIC * const found = mg_find(lsv, PERL_MAGIC_regex_global);
+       if (found && found->mg_len >= 0) {
+           I32 i = found->mg_len;
            if (DO_UTF8(lsv))
                sv_pos_b2u(lsv, &i);
            sv_setiv(sv, i + CopARYBASE_get(PL_curcop));
@@ -1786,23 +1787,26 @@
     SSize_t pos;
     STRLEN len;
     STRLEN ulen = 0;
+    MAGIC *found;
 
-    mg = 0;
+    PERL_UNUSED_ARG(mg);
 
     if (SvTYPE(lsv) >= SVt_PVMG && SvMAGIC(lsv))
-       mg = mg_find(lsv, PERL_MAGIC_regex_global);
-    if (!mg) {
+       found = mg_find(lsv, PERL_MAGIC_regex_global);
+    else
+       found = NULL;
+    if (!found) {
        if (!SvOK(sv))
            return 0;
 #ifdef PERL_OLD_COPY_ON_WRITE
     if (SvIsCOW(lsv))
         sv_force_normal_flags(lsv, 0);
 #endif
-       mg = sv_magicext(lsv, NULL, PERL_MAGIC_regex_global, &PL_vtbl_mglob,
+       found = sv_magicext(lsv, NULL, PERL_MAGIC_regex_global, &PL_vtbl_mglob,
                         NULL, 0);
     }
     else if (!SvOK(sv)) {
-       mg->mg_len = -1;
+       found->mg_len = -1;
        return 0;
     }
     len = SvPOK(lsv) ? SvCUR(lsv) : sv_len(lsv);
@@ -1829,8 +1833,8 @@
        pos = p;
     }
 
-    mg->mg_len = pos;
-    mg->mg_flags &= ~MGf_MINMATCH;
+    found->mg_len = pos;
+    found->mg_flags &= ~MGf_MINMATCH;
 
     return 0;
 }
@@ -2170,10 +2174,10 @@
 {
     PERL_UNUSED_CONTEXT;
     PERL_UNUSED_ARG(sv);
-     Safefree(mg->mg_ptr);     /* The mg_ptr holds the pos cache. */
-     mg->mg_ptr = 0;
-     mg->mg_len = -1;          /* The mg_len holds the len cache. */
-     return 0;
+    Safefree(mg->mg_ptr);      /* The mg_ptr holds the pos cache. */
+    mg->mg_ptr = NULL;
+    mg->mg_len = -1;           /* The mg_len holds the len cache. */
+    return 0;
 }
 
 int

==== //depot/maint-5.8/perl/op.c#170 (text) ====
Index: perl/op.c
--- perl/op.c#169~29929~        2007-01-22 15:29:42.000000000 -0800
+++ perl/op.c   2007-01-24 05:54:09.000000000 -0800
@@ -1019,10 +1019,10 @@
 Perl_scalarseq(pTHX_ OP *o)
 {
     if (o) {
-       if (o->op_type == OP_LINESEQ ||
-            o->op_type == OP_SCOPE ||
-            o->op_type == OP_LEAVE ||
-            o->op_type == OP_LEAVETRY)
+       const OPCODE type = o->op_type;
+
+       if (type == OP_LINESEQ || type == OP_SCOPE ||
+           type == OP_LEAVE || type == OP_LEAVETRY)
        {
             OP *kid;
            for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling) {
@@ -1833,44 +1833,47 @@
 Perl_bind_match(pTHX_ I32 type, OP *left, OP *right)
 {
     OP *o;
+    bool ismatchop;
+    const OPCODE ltype = left->op_type;
+    const OPCODE rtype = right->op_type;
 
-    if ( (left->op_type == OP_RV2AV ||
-       left->op_type == OP_RV2HV ||
-       left->op_type == OP_PADAV ||
-       left->op_type == OP_PADHV)
-       && ckWARN(WARN_MISC))
+    if ( (ltype == OP_RV2AV || ltype == OP_RV2HV || ltype == OP_PADAV
+         || ltype == OP_PADHV) && ckWARN(WARN_MISC))
     {
-      const char * const desc = PL_op_desc[(right->op_type == OP_SUBST ||
-                            right->op_type == OP_TRANS)
-                           ? right->op_type : OP_MATCH];
-      const char * const sample = ((left->op_type == OP_RV2AV ||
-                            left->op_type == OP_PADAV)
-                           ? "@array" : "%hash");
+      const char * const desc
+         = PL_op_desc[(rtype == OP_SUBST || rtype == OP_TRANS)
+            ? rtype : OP_MATCH];
+      const char * const sample = ((ltype == OP_RV2AV || ltype == OP_PADAV)
+            ? "@array" : "%hash");
       Perl_warner(aTHX_ packWARN(WARN_MISC),
              "Applying %s to %s will act on scalar(%s)",
              desc, sample, sample);
     }
 
-    if (right->op_type == OP_CONST &&
+    if (rtype == OP_CONST &&
        cSVOPx(right)->op_private & OPpCONST_BARE &&
        cSVOPx(right)->op_private & OPpCONST_STRICT)
     {
        no_bareword_allowed(right);
     }
 
-    if (!(right->op_flags & OPf_STACKED) &&
-       (right->op_type == OP_MATCH ||
-       right->op_type == OP_SUBST ||
-       right->op_type == OP_TRANS)) {
+    ismatchop = rtype == OP_MATCH ||
+               rtype == OP_SUBST ||
+               rtype == OP_TRANS;
+    if (!(right->op_flags & OPf_STACKED) && ismatchop) {
+       OP *newleft;
+
        right->op_flags |= OPf_STACKED;
-       if (right->op_type != OP_MATCH &&
-            ! (right->op_type == OP_TRANS &&
+       if (rtype != OP_MATCH &&
+            ! (rtype == OP_TRANS &&
                right->op_private & OPpTRANS_IDENTICAL))
-           left = mod(left, right->op_type);
+           newleft = mod(left, rtype);
+       else
+           newleft = left;
        if (right->op_type == OP_TRANS)
-           o = newBINOP(OP_NULL, OPf_STACKED, scalar(left), right);
+           o = newBINOP(OP_NULL, OPf_STACKED, scalar(newleft), right);
        else
-           o = prepend_elem(right->op_type, scalar(left), right);
+           o = prepend_elem(rtype, scalar(newleft), right);
        if (type == OP_NOT)
            return newUNOP(OP_NOT, 0, scalar(o));
        return o;
@@ -2142,12 +2145,12 @@
        goto nope;              /* Don't try to run w/ errors */
 
     for (curop = LINKLIST(o); curop != o; curop = LINKLIST(curop)) {
-       if ((curop->op_type != OP_CONST ||
-            (curop->op_private & OPpCONST_BARE)) &&
-           curop->op_type != OP_LIST &&
-           curop->op_type != OP_SCALAR &&
-           curop->op_type != OP_NULL &&
-           curop->op_type != OP_PUSHMARK)
+       const OPCODE type = curop->op_type;
+       if ((type != OP_CONST || (curop->op_private & OPpCONST_BARE)) &&
+           type != OP_LIST &&
+           type != OP_SCALAR &&
+           type != OP_NULL &&
+           type != OP_PUSHMARK)
        {
            goto nope;
        }
@@ -3315,13 +3318,18 @@
 STATIC I32
 S_is_list_assignment(pTHX_ register const OP *o)
 {
+    unsigned type;
+    U8 flags;
+
     if (!o)
        return TRUE;
 
-    if (o->op_type == OP_NULL && o->op_flags & OPf_KIDS)
+    if ((o->op_type == OP_NULL) && (o->op_flags & OPf_KIDS))
        o = cUNOPo->op_first;
 
-    if (o->op_type == OP_COND_EXPR) {
+    flags = o->op_flags;
+    type = o->op_type;
+    if (type == OP_COND_EXPR) {
         const I32 t = is_list_assignment(cLOGOPo->op_first->op_sibling);
         const I32 f = 
is_list_assignment(cLOGOPo->op_first->op_sibling->op_sibling);
 
@@ -3332,20 +3340,20 @@
        return FALSE;
     }
 
-    if (o->op_type == OP_LIST &&
-       (o->op_flags & OPf_WANT) == OPf_WANT_SCALAR &&
+    if (type == OP_LIST &&
+       (flags & OPf_WANT) == OPf_WANT_SCALAR &&
        o->op_private & OPpLVAL_INTRO)
        return FALSE;
 
-    if (o->op_type == OP_LIST || o->op_flags & OPf_PARENS ||
-       o->op_type == OP_RV2AV || o->op_type == OP_RV2HV ||
-       o->op_type == OP_ASLICE || o->op_type == OP_HSLICE)
+    if (type == OP_LIST || flags & OPf_PARENS ||
+       type == OP_RV2AV || type == OP_RV2HV ||
+       type == OP_ASLICE || type == OP_HSLICE)
        return TRUE;
 
-    if (o->op_type == OP_PADAV || o->op_type == OP_PADHV)
+    if (type == OP_PADAV || type == OP_PADHV)
        return TRUE;
 
-    if (o->op_type == OP_RV2SV)
+    if (type == OP_RV2SV)
        return FALSE;
 
     return FALSE;
@@ -3465,10 +3473,8 @@
                o->op_private |= OPpASSIGN_COMMON;
        }
        if (right && right->op_type == OP_SPLIT) {
-           OP* tmpop;
-           if ((tmpop = ((LISTOP*)right)->op_first) &&
-               tmpop->op_type == OP_PUSHRE)
-           {
+           OP* tmpop = ((LISTOP*)right)->op_first;
+           if (tmpop && (tmpop->op_type == OP_PUSHRE)) {
                PMOP * const pm = (PMOP*)tmpop;
                if (left->op_type == OP_RV2AV &&
                    !(left->op_private & OPpLVAL_INTRO) &&
@@ -5072,13 +5078,12 @@
        o = modkids(ck_fun(o), type);
        kid = cUNOPo->op_first;
        newop = kUNOP->op_first->op_sibling;
-       if (newop &&
-           (newop->op_sibling ||
-            !(PL_opargs[newop->op_type] & OA_RETSCALAR) ||
-            newop->op_type == OP_PADAV || newop->op_type == OP_PADHV ||
-            newop->op_type == OP_RV2AV || newop->op_type == OP_RV2HV)) {
-
-           return o;
+       if (newop) {
+           const OPCODE type = newop->op_type;
+           if (newop->op_sibling || !(PL_opargs[type] & OA_RETSCALAR) ||
+                   type == OP_PADAV || type == OP_PADHV ||
+                   type == OP_RV2AV || type == OP_RV2HV)
+               return o;
        }
        op_free(kUNOP->op_first);
        kUNOP->op_first = newop;
@@ -5357,8 +5362,9 @@
     }
     else if (o->op_flags & OPf_KIDS && cUNOPo->op_first->op_type != OP_STUB) {
        SVOP * const kid = (SVOP*)cUNOPo->op_first;
+       const OPCODE kidtype = kid->op_type;
 
-       if (kid->op_type == OP_CONST && (kid->op_private & OPpCONST_BARE)) {
+       if (kidtype == OP_CONST && (kid->op_private & OPpCONST_BARE)) {
            OP * const newop = newGVOP(type, OPf_REF,
                gv_fetchsv(kid->op_sv, GV_ADD, SVt_PVIO));
            op_free(o);
@@ -5845,7 +5851,7 @@
 OP *
 Perl_ck_sassign(pTHX_ OP *o)
 {
-    OP *kid = cLISTOPo->op_first;
+    OP * const kid = cLISTOPo->op_first;
     /* has a disposable target? */
     if ((PL_opargs[kid->op_type] & OA_TARGLEX)
        && !(kid->op_flags & OPf_STACKED)
@@ -6791,18 +6797,17 @@
            if (o->op_next && o->op_next->op_type == OP_NEXTSTATE
                && ckWARN(WARN_SYNTAX))
            {
-               if (o->op_next->op_sibling &&
-                       o->op_next->op_sibling->op_type != OP_EXIT &&
-                       o->op_next->op_sibling->op_type != OP_WARN &&
-                       o->op_next->op_sibling->op_type != OP_DIE) {
-                   const line_t oldline = CopLINE(PL_curcop);
-
-                   CopLINE_set(PL_curcop, CopLINE((COP*)o->op_next));
-                   Perl_warner(aTHX_ packWARN(WARN_EXEC),
-                               "Statement unlikely to be reached");
-                   Perl_warner(aTHX_ packWARN(WARN_EXEC),
-                               "\t(Maybe you meant system() when you said 
exec()?)\n");
-                   CopLINE_set(PL_curcop, oldline);
+               if (o->op_next->op_sibling) {
+                   const OPCODE type = o->op_next->op_sibling->op_type;
+                   if (type != OP_EXIT && type != OP_WARN && type != OP_DIE) {
+                       const line_t oldline = CopLINE(PL_curcop);
+                       CopLINE_set(PL_curcop, CopLINE((COP*)o->op_next));
+                       Perl_warner(aTHX_ packWARN(WARN_EXEC),
+                                   "Statement unlikely to be reached");
+                       Perl_warner(aTHX_ packWARN(WARN_EXEC),
+                                   "\t(Maybe you meant system() when you said 
exec()?)\n");
+                       CopLINE_set(PL_curcop, oldline);
+                   }
                }
            }
            break;

==== //depot/maint-5.8/perl/pp_ctl.c#152 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#151~29929~    2007-01-22 15:29:42.000000000 -0800
+++ perl/pp_ctl.c       2007-01-24 05:54:09.000000000 -0800
@@ -83,7 +83,7 @@
 #endif
 
     if (SvROK(tmpstr)) {
-       SV *sv = SvRV(tmpstr);
+       SV * const sv = SvRV(tmpstr);
        if(SvMAGICAL(sv))
            mg = mg_find(sv, PERL_MAGIC_qr);
     }
@@ -95,14 +95,14 @@
     else {
        STRLEN len;
        const char *t = SvPV_const(tmpstr, len);
+       regexp * const re = PM_GETRE(pm);
 
        /* Check against the last compiled regexp. */
-       if (!PM_GETRE(pm) || !PM_GETRE(pm)->precomp ||
-           PM_GETRE(pm)->prelen != (I32)len ||
-           memNE(PM_GETRE(pm)->precomp, t, len))
+       if (!re || !re->precomp || re->prelen != (I32)len ||
+           memNE(re->precomp, t, len))
        {
-           if (PM_GETRE(pm)) {
-               ReREFCNT_dec(PM_GETRE(pm));
+           if (re) {
+               ReREFCNT_dec(re);
                PM_SETRE(pm, NULL);     /* crucial if regcomp aborts */
            }
            if (PL_op->op_flags & OPf_SPECIAL)

==== //depot/maint-5.8/perl/proto.h#170 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#169~29926~     2007-01-22 14:47:32.000000000 -0800
+++ perl/proto.h        2007-01-24 05:54:09.000000000 -0800
@@ -1874,6 +1874,9 @@
 #if defined(PERL_IN_DUMP_C) || defined(PERL_DECL_PROT)
 STATIC CV*     S_deb_curcv(pTHX_ I32 ix);
 STATIC void    S_debprof(pTHX_ const OP *o);
+STATIC SV*     S_pm_description(pTHX_ const PMOP *pm)
+                       __attribute__nonnull__(pTHX_1);
+
 #endif
 
 #if defined(PERL_IN_SCOPE_C) || defined(PERL_DECL_PROT)

==== //depot/maint-5.8/perl/thread.h#19 (text) ====
Index: perl/thread.h
--- perl/thread.h#18~29802~     2007-01-13 16:36:51.000000000 -0800
+++ perl/thread.h       2007-01-24 05:54:09.000000000 -0800
@@ -333,8 +333,7 @@
 #ifndef ALLOC_THREAD_KEY
 #  define ALLOC_THREAD_KEY \
     STMT_START {                                               \
-       int _eC_;                                               \
-       if ((_eC_ = pthread_key_create(&PL_thr_key, 0))) {      \
+       if (pthread_key_create(&PL_thr_key, 0)) {               \
             write(2, STR_WITH_LEN("panic: pthread_key_create failed\n")); \
            exit(1);                                            \
        }                                                       \
End of Patch.

Reply via email to