This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix #56194 Regex: (((??{1 + $^N}))) behaves differently in 5.10.0 than in blead
[perl5.git] / op.c
diff --git a/op.c b/op.c
index 024996d..5103efb 100644 (file)
--- a/op.c
+++ b/op.c
@@ -785,7 +785,7 @@ Perl_op_refcnt_unlock(pTHX)
 
 #define LINKLIST(o) ((o)->op_next ? (o)->op_next : linklist((OP*)o))
 
-OP *
+static OP *
 S_linklist(pTHX_ OP *o)
 {
     OP *first;
@@ -817,7 +817,7 @@ S_linklist(pTHX_ OP *o)
     return o->op_next;
 }
 
-OP *
+static OP *
 S_scalarkids(pTHX_ OP *o)
 {
     if (o && o->op_flags & OPf_KIDS) {
@@ -848,7 +848,6 @@ S_scalarboolean(pTHX_ OP *o)
     return scalar(o);
 }
 
-/* This is used in S_doeval in pp_ctl.c  */
 OP *
 Perl_scalar(pTHX_ OP *o)
 {
@@ -922,7 +921,6 @@ Perl_scalar(pTHX_ OP *o)
     return o;
 }
 
-/* This is used in S_doeval in pp_ctl.c  */
 OP *
 Perl_scalarvoid(pTHX_ OP *o)
 {
@@ -1207,7 +1205,7 @@ Perl_scalarvoid(pTHX_ OP *o)
     return o;
 }
 
-OP *
+static OP *
 S_listkids(pTHX_ OP *o)
 {
     if (o && o->op_flags & OPf_KIDS) {
@@ -1218,7 +1216,6 @@ S_listkids(pTHX_ OP *o)
     return o;
 }
 
-/* This is used in S_doeval in pp_ctl.c  */
 OP *
 Perl_list(pTHX_ OP *o)
 {
@@ -1296,7 +1293,7 @@ Perl_list(pTHX_ OP *o)
     return o;
 }
 
-OP *
+static OP *
 S_scalarseq(pTHX_ OP *o)
 {
     dVAR;
@@ -1769,8 +1766,8 @@ S_is_handle_constructor(const OP *o, I32 numargs)
     }
 }
 
-OP *
-Perl_refkids(pTHX_ OP *o, I32 type)
+static OP *
+S_refkids(pTHX_ OP *o, I32 type)
 {
     if (o && o->op_flags & OPf_KIDS) {
         OP *kid;
@@ -2154,7 +2151,6 @@ Perl_my_attrs(pTHX_ OP *o, OP *attrs)
     return o;
 }
 
-/* This is used in perly.y  */
 OP *
 Perl_sawparens(pTHX_ OP *o)
 {
@@ -2342,8 +2338,7 @@ Perl_newPROG(pTHX_ OP *o)
 
        /* Register with debugger */
        if (PERLDB_INTER) {
-           CV * const cv
-               = Perl_get_cvn_flags(aTHX_ STR_WITH_LEN("DB::postponed"), 0);
+           CV * const cv = get_cvs("DB::postponed", 0);
            if (cv) {
                dSP;
                PUSHMARK(SP);
@@ -2430,7 +2425,7 @@ Perl_jmaybe(pTHX_ OP *o)
     return o;
 }
 
-OP *
+static OP *
 S_fold_constants(pTHX_ register OP *o)
 {
     dVAR;
@@ -2571,7 +2566,7 @@ S_fold_constants(pTHX_ register OP *o)
     return o;
 }
 
-OP *
+static OP *
 S_gen_constant_list(pTHX_ register OP *o)
 {
     dVAR;
@@ -2985,7 +2980,7 @@ Perl_newNULLLIST(pTHX)
     return newOP(OP_STUB, 0);
 }
 
-OP *
+static OP *
 S_force_list(pTHX_ OP *o)
 {
     if (!o || o->op_type != OP_LIST)
@@ -3123,8 +3118,8 @@ static int uvcompare(const void *a, const void *b)
     return 0;
 }
 
-OP *
-Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
+static OP *
+S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
 {
     dVAR;
     SV * const tstr = ((SVOP*)expr)->op_sv;
@@ -5963,14 +5958,11 @@ Perl_newCONSTSUB(pTHX_ HV *stash, const char *name, SV *sv)
     dVAR;
     CV* cv;
 #ifdef USE_ITHREADS
-    const char *const temp_p = CopFILE(PL_curcop);
-    const STRLEN len = temp_p ? strlen(temp_p) : 0;
+    const char *const file = CopFILE(PL_curcop);
 #else
     SV *const temp_sv = CopFILESV(PL_curcop);
-    STRLEN len;
-    const char *const temp_p = temp_sv ? SvPV_const(temp_sv, len) : NULL;
+    const char *const file = temp_sv ? SvPV_nolen_const(temp_sv) : NULL;
 #endif
-    char *const file = savepvn(temp_p, temp_p ? len : 0);
 
     ENTER;
 
@@ -5998,10 +5990,10 @@ Perl_newCONSTSUB(pTHX_ HV *stash, const char *name, SV *sv)
        and so doesn't get free()d.  (It's expected to be from the C pre-
        processor __FILE__ directive). But we need a dynamically allocated one,
        and we need it to get freed.  */
-    cv = newXS_flags(name, const_sv_xsub, file, "", XS_DYNAMIC_FILENAME);
+    cv = newXS_flags(name, const_sv_xsub, file ? file : "", "",
+                    XS_DYNAMIC_FILENAME);
     CvXSUBANY(cv).any_ptr = sv;
     CvCONST_on(cv);
-    Safefree(file);
 
 #ifdef USE_ITHREADS
     if (stash)