Change 30291 by [EMAIL PROTECTED] on 2007/02/14 16:37:49
Integrate:
[ 29761]
Fix bug [perl #41234] : the tokenizer understands "=cute"
or other words that begin with "cut" as synonyms for "=cut"
[ 29762]
Update copyright year in "perl -v" output
[ 29765]
make tr/// threadsafe by moving swash into pad
[ 29784]
Subject: Re: AW: umask handling in File::Temp
From: Gisle Aas <[EMAIL PROTECTED]>
Date: 12 Jan 2007 16:10:16 +0100
Message-ID: <[EMAIL PROTECTED]>
[ 29837]
when cloning PL_regex_pad, copy SVf_BREAK flag too
[ 29839]
make Dump display the SVf_BREAK flag
[ 30147]
Subject: [PATCH] fix 2 environment handling bugs
From: Jan Dubois <[EMAIL PROTECTED]>
Date: Mon, 05 Feb 2007 21:45:36 -0800
Message-ID: <[EMAIL PROTECTED]>
[ 30211]
Subject: [perl #41484] qr// stack bug
From: [EMAIL PROTECTED] (via RT) <[EMAIL PROTECTED]>
Date: Sat, 10 Feb 2007 19:32:17 -0800
Message-ID: <[EMAIL PROTECTED]>
[ 30212]
Convert new test to using t/test.pl.
(No idea where it could fit better. And since it uses the stack,
it's a bit fragile)
[ 30228]
Subject: Re: PL_copline inconsistency
From: Rick Delaney <[EMAIL PROTECTED]>
Date: Sat, 27 Jan 2007 20:29:02 -0500
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/maint-5.8/perl/MANIFEST#331 integrate
... //depot/maint-5.8/perl/doop.c#51 integrate
... //depot/maint-5.8/perl/dump.c#78 integrate
... //depot/maint-5.8/perl/op.c#198 integrate
... //depot/maint-5.8/perl/perl.c#204 integrate
... //depot/maint-5.8/perl/pp_hot.c#131 integrate
... //depot/maint-5.8/perl/pp_sys.c#142 integrate
... //depot/maint-5.8/perl/sv.c#342 integrate
... //depot/maint-5.8/perl/t/op/qrstack.t#1 branch
... //depot/maint-5.8/perl/toke.c#165 integrate
Differences ...
==== //depot/maint-5.8/perl/MANIFEST#331 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#330~30288~ 2007-02-14 07:29:27.000000000 -0800
+++ perl/MANIFEST 2007-02-14 08:37:49.000000000 -0800
@@ -2870,6 +2870,7 @@
t/op/push.t See if push and pop work
t/op/pwent.t See if getpw*() functions work
t/op/qq.t See if qq works
+t/op/qrstack.t See if qr expands the stack properly
t/op/quotemeta.t See if quotemeta works
t/op/rand.t See if rand works
t/op/range.t See if .. works
==== //depot/maint-5.8/perl/doop.c#51 (text) ====
Index: perl/doop.c
--- perl/doop.c#50~30094~ 2007-02-02 08:57:24.000000000 -0800
+++ perl/doop.c 2007-02-14 08:37:49.000000000 -0800
@@ -301,7 +301,12 @@
const I32 grows = PL_op->op_private & OPpTRANS_GROWS;
STRLEN len;
- SV* const rv = (SV*)cSVOP->op_sv;
+ SV* const rv =
+#ifdef USE_ITHREADS
+ PAD_SVl(cPADOP->op_padix);
+#else
+ (SV*)cSVOP->op_sv;
+#endif
HV* const hv = (HV*)SvRV(rv);
SV* const * svp = hv_fetchs(hv, "NONE", FALSE);
const UV none = svp ? SvUV(*svp) : 0x7fffffff;
@@ -396,7 +401,12 @@
I32 matches = 0;
STRLEN len;
- SV* const rv = (SV*)cSVOP->op_sv;
+ SV* const rv =
+#ifdef USE_ITHREADS
+ PAD_SVl(cPADOP->op_padix);
+#else
+ (SV*)cSVOP->op_sv;
+#endif
HV* const hv = (HV*)SvRV(rv);
SV* const * const svp = hv_fetchs(hv, "NONE", FALSE);
const UV none = svp ? SvUV(*svp) : 0x7fffffff;
@@ -439,7 +449,12 @@
const I32 squash = PL_op->op_private & OPpTRANS_SQUASH;
const I32 del = PL_op->op_private & OPpTRANS_DELETE;
const I32 grows = PL_op->op_private & OPpTRANS_GROWS;
- SV * const rv = (SV*)cSVOP->op_sv;
+ SV* const rv =
+#ifdef USE_ITHREADS
+ PAD_SVl(cPADOP->op_padix);
+#else
+ (SV*)cSVOP->op_sv;
+#endif
HV * const hv = (HV*)SvRV(rv);
SV * const *svp = hv_fetchs(hv, "NONE", FALSE);
const UV none = svp ? SvUV(*svp) : 0x7fffffff;
==== //depot/maint-5.8/perl/dump.c#78 (text) ====
Index: perl/dump.c
--- perl/dump.c#77~30118~ 2007-02-04 11:27:45.000000000 -0800
+++ perl/dump.c 2007-02-14 08:37:49.000000000 -0800
@@ -1195,6 +1195,7 @@
if (flags & SVf_OOK) sv_catpv(d, "OOK,");
if (flags & SVf_FAKE) sv_catpv(d, "FAKE,");
if (flags & SVf_READONLY) sv_catpv(d, "READONLY,");
+ if (flags & SVf_BREAK) sv_catpv(d, "BREAK,");
if (flags & SVf_AMAGIC && type != SVt_PVHV)
sv_catpv(d, "OVERLOAD,");
==== //depot/maint-5.8/perl/op.c#198 (text) ====
Index: perl/op.c
--- perl/op.c#197~30241~ 2007-02-12 12:43:49.000000000 -0800
+++ perl/op.c 2007-02-14 08:37:49.000000000 -0800
@@ -435,8 +435,15 @@
/* FALL THROUGH */
case OP_TRANS:
if (o->op_private & (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF)) {
+#ifdef USE_ITHREADS
+ if (cPADOPo->op_padix > 0) {
+ pad_swipe(cPADOPo->op_padix, TRUE);
+ cPADOPo->op_padix = 0;
+ }
+#else
SvREFCNT_dec(cSVOPo->op_sv);
cSVOPo->op_sv = NULL;
+#endif
}
else {
Safefree(cPVOPo->op_pv);
@@ -2494,6 +2501,7 @@
const I32 complement = o->op_private & OPpTRANS_COMPLEMENT;
const I32 squash = o->op_private & OPpTRANS_SQUASH;
I32 del = o->op_private & OPpTRANS_DELETE;
+ SV* swash;
PL_hints |= HINT_BLOCK_SCOPE;
if (SvUTF8(tstr))
@@ -2688,12 +2696,21 @@
bits = 8;
Safefree(cPVOPo->op_pv);
- cSVOPo->op_sv = (SV*)swash_init("utf8", "", listsv, bits, none);
+
+ swash = (SV*)swash_init("utf8", "", listsv, bits, none);
+#ifdef USE_ITHREADS
+ cPADOPo->op_padix = pad_alloc(OP_TRANS, SVs_PADTMP);
+ SvREFCNT_dec(PAD_SVl(cPADOPo->op_padix));
+ PAD_SETSV(cPADOPo->op_padix, swash);
+ SvPADTMP_on(swash);
+#else
+ cSVOPo->op_sv = swash;
+#endif
SvREFCNT_dec(listsv);
SvREFCNT_dec(transv);
if (!del && havefinal && rlen)
- (void)hv_store((HV*)SvRV((cSVOPo->op_sv)), "FINAL", 5,
+ (void)hv_store((HV*)SvRV(swash), "FINAL", 5,
newSVuv((UV)final), 0);
if (grows)
==== //depot/maint-5.8/perl/perl.c#204 (text) ====
Index: perl/perl.c
--- perl/perl.c#203~30241~ 2007-02-12 12:43:49.000000000 -0800
+++ perl/perl.c 2007-02-14 08:37:49.000000000 -0800
@@ -1609,8 +1609,10 @@
break;
}
}
+
+#ifndef PERL_USE_SAFE_PUTENV
/* Can we grab env area too to be used as the area for $0? */
- if (s && PL_origenviron) {
+ if (s && PL_origenviron && !PL_use_safe_putenv) {
if ((PL_origenviron[0] == s + 1
#ifdef OS2
|| (PL_origenviron[0] == s + 9 && (s += 8))
@@ -1646,6 +1648,8 @@
}
}
}
+#endif /* !defined(PERL_USE_SAFE_PUTENV) */
+
PL_origalen = s ? s - PL_origargv[0] + 1 : 0;
}
@@ -3392,7 +3396,7 @@
#endif
PerlIO_printf(PerlIO_stdout(),
- "\n\nCopyright 1987-2006, Larry Wall\n");
+ "\n\nCopyright 1987-2007, Larry Wall\n");
#ifdef MACOS_TRADITIONAL
PerlIO_printf(PerlIO_stdout(),
"\nMac OS port Copyright 1991-2002, Matthias Neeracher;\n"
@@ -4760,7 +4764,6 @@
environ[0] = NULL;
}
if (env) {
- char** origenv = environ;
char *s;
SV *sv;
for (; *env; env++) {
@@ -4775,11 +4778,6 @@
(void)hv_store(hv, *env, s - *env, sv, 0);
if (env_is_not_environ)
mg_set(sv);
- if (origenv != environ) {
- /* realloc has shifted us */
- env = (env - origenv) + environ;
- origenv = environ;
- }
}
}
#endif /* USE_ENVIRON_ARRAY */
==== //depot/maint-5.8/perl/pp_hot.c#131 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#130~30196~ 2007-02-10 11:13:38.000000000 -0800
+++ perl/pp_hot.c 2007-02-14 08:37:49.000000000 -0800
@@ -1175,7 +1175,8 @@
if (pm->op_pmdynflags & PMdf_TAINTED)
SvTAINTED_on(rv);
sv_magic(sv,(SV*)ReREFCNT_inc(PM_GETRE(pm)), PERL_MAGIC_qr,0,0);
- RETURNX(PUSHs(rv));
+ XPUSHs(rv);
+ RETURN;
}
PP(pp_match)
==== //depot/maint-5.8/perl/pp_sys.c#142 (text) ====
Index: perl/pp_sys.c
--- perl/pp_sys.c#141~30094~ 2007-02-02 08:57:24.000000000 -0800
+++ perl/pp_sys.c 2007-02-14 08:37:49.000000000 -0800
@@ -703,8 +703,12 @@
Mode_t anum;
if (MAXARG < 1) {
- anum = PerlLIO_umask(0);
- (void)PerlLIO_umask(anum);
+ anum = PerlLIO_umask(022);
+ /* setting it to 022 between the two calls to umask avoids
+ * to have a window where the umask is set to 0 -- meaning
+ * that another thread could create world-writeable files. */
+ if (anum != 022)
+ (void)PerlLIO_umask(anum);
}
else
anum = PerlLIO_umask(POPi);
==== //depot/maint-5.8/perl/sv.c#342 (text) ====
Index: perl/sv.c
--- perl/sv.c#341~30232~ 2007-02-12 08:27:14.000000000 -0800
+++ perl/sv.c 2007-02-14 08:37:49.000000000 -0800
@@ -10515,6 +10515,8 @@
newSViv(PTR2IV(re_dup(
INT2PTR(REGEXP *, SvIVX(regex)), param))))
;
+ if (SvFLAGS(regex) & SVf_BREAK)
+ SvFLAGS(sv) |= SVf_BREAK; /* unrefcnted PL_curpm */
av_push(PL_regex_padav, sv);
}
}
==== //depot/maint-5.8/perl/t/op/qrstack.t#1 (text) ====
Index: perl/t/op/qrstack.t
--- /dev/null 2007-01-16 11:55:45.526841103 -0800
+++ perl/t/op/qrstack.t 2007-02-14 08:37:49.000000000 -0800
@@ -0,0 +1,11 @@
+#!./perl -w
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require './test.pl';
+}
+
+plan tests => 1;
+
+ok(defined [(1)x127,qr//,1]->[127], "qr// should extend the stack properly");
==== //depot/maint-5.8/perl/toke.c#165 (text) ====
Index: perl/toke.c
--- perl/toke.c#164~30290~ 2007-02-14 08:13:48.000000000 -0800
+++ perl/toke.c 2007-02-14 08:37:49.000000000 -0800
@@ -588,6 +588,7 @@
SAVEINT(PL_expect);
SAVEINT(PL_lex_expect);
+ PL_copline = NOLINE;
PL_lex_state = LEX_NORMAL;
PL_lex_defer = 0;
PL_expect = XSTATE;
@@ -2942,7 +2943,7 @@
}
if (PL_doextract) {
/* Incest with pod. */
- if (*s == '=' && strnEQ(s, "=cut", 4)) {
+ if (*s == '=' && strnEQ(s, "=cut", 4) && !isALPHA(s[4])) {
sv_setpvn(PL_linestr, "", 0);
PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart =
SvPVX(PL_linestr);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
End of Patch.