Discussion:
Change 32394: Integrate:
(too old to reply)
nwc10+ (Nicholas Clark)
2007-11-18 22:30:07 UTC
Permalink
Change 32394 by ***@nicholas-saigo on 2007/11/18 22:16:34

Integrate:
[ 31377]
Fix [perl #43207] lc() or uc() inside sort affect the return value.

[ 31387]
Subject: [PATCH] Re: vsprintf
From: Andy Dougherty <***@lafayette.edu>
Date: Thu, 14 Jun 2007 13:12:57 -0400 (EDT)
Message-ID: <***@fractal.phys.lafayette.edu>

[ 31447]
safely handle cloning a stale lexical var
This code:
my $x if ...; sub { $x}
could attempt to clone $x even if $x is stale.

[ 31587]
Subject: [PATCH blead] Re: [perl #43545] 'no warnings' effects $@.
From: Rick Delaney <***@bort.ca>
Date: Sat, 7 Jul 2007 23:06:11 -0400
Message-ID: <***@bort.ca>

[ 31690]
Make '-xx' and '-x x' work the same way (see #44387).

[ 31691]
Revert #31690, because it can make -x eat arguments. Even if the
next argument happens to be a directory name, changing this does
not seem worthwhile. It's as likely as not to break something.

The many -x users clamouring for consistency must go home
empty-handed, alas.

[ 31696]
Subject: [PATCH] Test '-x dir'
From: "Jerry D. Hedden" <***@cpan.org>
Date: Thu, 9 Aug 2007 08:28:17 -0400
Message-ID: <***@mail.gmail.com>

[ 31699]
Subject: Re: [PATCH] Adding more information to "Unrecognized character" error in toke.c
From: Claes Jakobsson <***@surfar.nu>
Date: Sat, 4 Aug 2007 16:00:19 +0200
Message-Id: <57CEC660-0020-48DF-A72A-***@surfar.nu>

[ 31700]
Fix compilation with threads

[ 31730]
Subject: [PATCH blead] Re: t/op/taint.t failed on EBCDIC platform
From: Rick Delaney <***@bort.ca>
Date: Thu, 16 Aug 2007 23:35:26 -0400
Message-Id: <***@bort.ca>

[ 31854]
Subject: [perl #45383] sprintf %f panics with NaN
From: Zefram (via RT) <perlbug-***@perl.org>
Date: Tue, 11 Sep 2007 15:22:23 -0700
Message-ID: <rt-3.6.HEAD-10743-1189549342-52.45383-75-***@perl.org>

[ 31855]
Amend change 31854 for when NAN_COMPARE_BROKEN

[ 31856]
Don't call frexp() on +Inf or -Inf either. (It's not just NaN it might
choke on.)

[ 31867]
[perl #45337] utf8 + "[a]a{2}" + /$.../ = panic: sv_len_utf8 cache
when shrinking an SV, shrink the sv_len_utf8 cache too!

Affected files ...

... //depot/maint-5.8/perl/MANIFEST#398 integrate
... //depot/maint-5.8/perl/perl.c#219 integrate
... //depot/maint-5.8/perl/pod/perldiag.pod#106 integrate
... //depot/maint-5.8/perl/pp.c#147 integrate
... //depot/maint-5.8/perl/pp_sys.c#154 integrate
... //depot/maint-5.8/perl/regcomp.c#114 integrate
... //depot/maint-5.8/perl/sv.c#367 integrate
... //depot/maint-5.8/perl/t/base/lex.t#4 integrate
... //depot/maint-5.8/perl/t/op/eval.t#9 integrate
... //depot/maint-5.8/perl/t/op/lc.t#13 integrate
... //depot/maint-5.8/perl/t/op/pat.t#48 integrate
... //depot/maint-5.8/perl/t/run/switchx.aux#2 integrate
... //depot/maint-5.8/perl/t/run/switchx.t#3 integrate
... //depot/maint-5.8/perl/t/run/switchx2.aux#1 branch
... //depot/maint-5.8/perl/toke.c#178 integrate
... //depot/maint-5.8/perl/util.c#157 integrate

Differences ...

==== //depot/maint-5.8/perl/MANIFEST#398 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#397~32382~ 2007-11-17 12:52:52.000000000 -0800
+++ perl/MANIFEST 2007-11-18 14:16:34.000000000 -0800
@@ -3172,6 +3172,7 @@
t/run/switchPx.t Test the -Px combination
t/run/switcht.t Test the -t switch
t/run/switchx.aux Data for switchx.t
+t/run/switchx2.aux Data for switchx.t
t/run/switchx.t Test the -x switch
t/TEST The regression tester
t/TestInit.pm Preamble library for core tests

==== //depot/maint-5.8/perl/pod/perldiag.pod#106 (text) ====
Index: perl/pod/perldiag.pod
--- perl/pod/perldiag.pod#105~32364~ 2007-11-17 05:28:27.000000000 -0800
+++ perl/pod/perldiag.pod 2007-11-18 14:16:34.000000000 -0800
@@ -4181,11 +4181,11 @@
somehow, or insert an underbar into it. You might also declare it as a
subroutine.

-=item Unrecognized character %s
+=item Unrecognized character %s in column %d

(F) The Perl parser has no idea what to do with the specified character
-in your Perl script (or eval). Perhaps you tried to run a compressed
-script, a binary program, or a directory as a Perl program.
+in your Perl script (or eval) at the specified column. Perhaps you tried
+to run a compressed script, a binary program, or a directory as a Perl program.

=item /%s/: Unrecognized escape \\%c in character class passed through


==== //depot/maint-5.8/perl/pp.c#147 (text) ====
Index: perl/pp.c
--- perl/pp.c#146~32391~ 2007-11-18 12:28:30.000000000 -0800
+++ perl/pp.c 2007-11-18 14:16:34.000000000 -0800
@@ -3519,7 +3519,7 @@
need = slen + 1;
}

- if (SvPADTMP(source) && !SvREADONLY(source) && inplace) {
+ if (SvPADTMP(source) && !SvREADONLY(source) && inplace && SvTEMP(source)) {
/* We can convert in place. */

dest = source;
@@ -3601,7 +3601,7 @@
SvGETMAGIC(source);

if (SvPADTMP(source) && !SvREADONLY(source) && !SvAMAGIC(source)
- && !DO_UTF8(source)) {
+ && SvTEMP(source) && !DO_UTF8(source)) {
/* We can convert in place. */

dest = source;
@@ -3700,7 +3700,7 @@
SvGETMAGIC(source);

if (SvPADTMP(source) && !SvREADONLY(source) && !SvAMAGIC(source)
- && !DO_UTF8(source)) {
+ && SvTEMP(source) && !DO_UTF8(source)) {
/* We can convert in place. */

dest = source;

==== //depot/maint-5.8/perl/pp_sys.c#154 (text) ====
Index: perl/pp_sys.c
--- perl/pp_sys.c#153~32391~ 2007-11-18 12:28:30.000000000 -0800
+++ perl/pp_sys.c 2007-11-18 14:16:34.000000000 -0800
@@ -5155,7 +5155,7 @@
# ifdef PWGECOS
PUSHs(sv = sv_2mortal(newSVpv(pwent->pw_gecos, 0)));
# else
- PUSHs(sv_mortalcopy(&PL_sv_no));
+ PUSHs(sv = sv_mortalcopy(&PL_sv_no));
# endif
# ifndef INCOMPLETE_TAINTS
/* pw_gecos is tainted because user himself can diddle with it. */

==== //depot/maint-5.8/perl/regcomp.c#114 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#113~32368~ 2007-11-17 07:06:50.000000000 -0800
+++ perl/regcomp.c 2007-11-18 14:16:34.000000000 -0800
@@ -1281,7 +1281,7 @@
SvUTF8(sv) && SvMAGICAL(sv) ?
mg_find(sv, PERL_MAGIC_utf8) : NULL;
if (mg && mg->mg_len >= 0)
- mg->mg_len += CHR_SVLEN(last_str);
+ mg->mg_len += CHR_SVLEN(last_str) - l;
}
data->last_end += l * (mincount - 1);
}

==== //depot/maint-5.8/perl/sv.c#367 (text) ====
Index: perl/sv.c
--- perl/sv.c#366~32391~ 2007-11-18 12:28:30.000000000 -0800
+++ perl/sv.c 2007-11-18 14:16:34.000000000 -0800
@@ -8765,7 +8765,9 @@
: SvNV(argsv);

need = 0;
- if (c != 'e' && c != 'E') {
+ /* nv * 0 will be NaN for NaN, +Inf and -Inf, and 0 for anything
+ else. frexp() has some unspecified behaviour for those three */
+ if (c != 'e' && c != 'E' && (nv * 0) == 0) {
i = PERL_INT_MIN;
/* FIXME: if HAS_LONG_DOUBLE but not USE_LONG_DOUBLE this
will cast our (long double) to (double) */

==== //depot/maint-5.8/perl/t/base/lex.t#4 (xtext) ====
Index: perl/t/base/lex.t
--- perl/t/base/lex.t#3~32379~ 2007-11-17 12:42:55.000000000 -0800
+++ perl/t/base/lex.t 2007-11-18 14:16:34.000000000 -0800
@@ -1,6 +1,6 @@
#!./perl

-print "1..55\n";
+print "1..56\n";

$x = 'x';

@@ -263,3 +263,7 @@

sub foo::::::bar { print "ok $test\n"; $test++ }
foo::::::bar;
+
+eval "\$x =\xE2foo";
+if ($@ =~ /Unrecognized character \\xE2 in column 5/) { print "ok $test\n"; } else { print "not ok $test\n"; }
+$test++;

==== //depot/maint-5.8/perl/t/op/eval.t#9 (xtext) ====
Index: perl/t/op/eval.t
--- perl/t/op/eval.t#8~30127~ 2007-02-05 03:57:18.000000000 -0800
+++ perl/t/op/eval.t 2007-11-18 14:16:34.000000000 -0800
@@ -5,7 +5,7 @@
@INC = '../lib';
}

-print "1..93\n";
+print "1..94\n";

eval 'print "ok 1\n";';

@@ -455,6 +455,13 @@
local $@ = "foo";
eval undef;
print "not " unless $@ eq "";
- print "ok $test # eval unef \n"; $test++;
+ print "ok $test # eval undef \n"; $test++;
+}
+
+{
+ no warnings;
+ eval "/ /a;";
+ print "not " unless $@ =~ /^syntax error/;
+ print "ok $test # eval syntax error, no warnings \n"; $test++;
}


==== //depot/maint-5.8/perl/t/op/lc.t#13 (text) ====
Index: perl/t/op/lc.t
--- perl/t/op/lc.t#12~28169~ 2006-05-11 13:23:59.000000000 -0700
+++ perl/t/op/lc.t 2007-11-18 14:16:34.000000000 -0800
@@ -6,7 +6,7 @@
require './test.pl';
}

-plan tests => 87;
+plan tests => 88;

$a = "HELLO.* world";
$b = "hello.* WORLD";
@@ -205,3 +205,10 @@

is(lc "\x{0130}" x $_, "i\x{307}" x $_, 'lc U+0130 grows');
}
+
+# bug #43207
+my $temp = "Hello";
+for ("$temp") {
+ lc $_;
+ is($_, "Hello");
+}

==== //depot/maint-5.8/perl/t/op/pat.t#48 (xtext) ====
Index: perl/t/op/pat.t
--- perl/t/op/pat.t#47~32333~ 2007-11-16 04:46:24.000000000 -0800
+++ perl/t/op/pat.t 2007-11-18 14:16:34.000000000 -0800
@@ -3806,5 +3806,14 @@
}
}

+# [perl #45337] utf8 + "[a]a{2}" + /$.../ = panic: sv_len_utf8 cache
+
+{
+ local ${^UTF8CACHE} = -1;
+ my $s="[a]a{2}";
+ utf8::upgrade $s;
+ ok("aaa" =~ /$s/, "#45337");
+}
+
# Don't forget to update this!
-BEGIN{print "1..1267\n"};
+BEGIN{print "1..1268\n"};

==== //depot/maint-5.8/perl/t/run/switchx.aux#2 (text) ====
Index: perl/t/run/switchx.aux
--- perl/t/run/switchx.aux#1~17645~ 2002-07-19 12:29:57.000000000 -0700
+++ perl/t/run/switchx.aux 2007-11-18 14:16:34.000000000 -0800
@@ -17,5 +17,14 @@

#!/some/path/that/leads/to/perl -l

-print "1..1";
-print "ok 1";
+print "1..4";
+if (-f 'run/switchx.aux') {
+ print "ok 1";
+}
+print "ok 2";
+# other tests are in switchx2.aux
+
+__END__
+
+# This is ignored
+print "not ok 2";

==== //depot/maint-5.8/perl/t/run/switchx.t#3 (text) ====
Index: perl/t/run/switchx.t
--- perl/t/run/switchx.t#2~22089~ 2004-01-07 05:19:41.000000000 -0800
+++ perl/t/run/switchx.t 2007-11-18 14:16:34.000000000 -0800
@@ -8,4 +8,13 @@
require './test.pl';
use File::Spec::Functions;

-print runperl( switches => ['-x'], progfile => catfile(curdir(), 'run', 'switchx.aux') );
+# Test '-x'
+print runperl( switches => ['-x'],
+ progfile => catfile(curdir(), 'run', 'switchx.aux') );
+
+# Test '-xdir'
+print runperl( switches => ['-x' . catfile(curdir(), 'run')],
+ progfile => catfile(curdir(), 'run', 'switchx2.aux'),
+ args => [ 3 ] );
+
+# EOF

==== //depot/maint-5.8/perl/t/run/switchx2.aux#1 (text) ====
Index: perl/t/run/switchx2.aux
--- /dev/null 2007-11-15 23:45:26.536423275 -0800
+++ perl/t/run/switchx2.aux 2007-11-18 14:16:34.000000000 -0800
@@ -0,0 +1,32 @@
+From: ***@bar.xx
+Date: Jan 1, 2037 12:34 PM
+Subject: Ignore mail header
+To: ***@perl.xx
+
+#perl
+Not perl
+
+#!
+Still not perl
+
+#!/something/else
+Still not perl
+
+#!/usr/bin/bash
+# Ignore shell commands
+if [[ -z $FOO ]]; then echo 'not ok 1'; fi
+
+#!/some/path/that/leads/to/perl -l
+
+# These lines get executed
+my $test = $ARGV[0];
+if (-f 'switchx.t') {
+ print("ok $test");
+}
+$test++;
+print "ok $test";
+
+__END__
+
+# This is ignored
+print "not ok $test";

==== //depot/maint-5.8/perl/toke.c#178 (text) ====
Index: perl/toke.c
--- perl/toke.c#177~32386~ 2007-11-17 16:15:44.000000000 -0800
+++ perl/toke.c 2007-11-18 14:16:34.000000000 -0800
@@ -2807,7 +2807,8 @@
default:
if (isIDFIRST_lazy_if(s,UTF))
goto keylookup;
- Perl_croak(aTHX_ "Unrecognized character \\x%02X", *s & 255);
+ len = UTF ? Perl_utf8_length(aTHX_ (U8 *) PL_linestart, (U8 *) s) : (STRLEN) (s - PL_linestart);
+ Perl_croak(aTHX_ "Unrecognized character \\x%02X in column %d", *s & 255, (int) len + 1);
case 4:
case 26:
goto fake_eof; /* emulate EOF on ^D or ^Z */
@@ -11034,8 +11035,10 @@
(int)PL_multi_open,(int)PL_multi_close,(IV)PL_multi_start);
PL_multi_end = 0;
}
- if (PL_in_eval & EVAL_WARNONLY && ckWARN_d(WARN_SYNTAX))
- Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "%"SVf, (void*)msg);
+ if (PL_in_eval & EVAL_WARNONLY) {
+ if (ckWARN_d(WARN_SYNTAX))
+ Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "%"SVf, (void*)msg);
+ }
else
qerror(msg);
if (PL_error_count >= 10) {

==== //depot/maint-5.8/perl/util.c#157 (text) ====
Index: perl/util.c
--- perl/util.c#156~32384~ 2007-11-17 14:34:52.000000000 -0800
+++ perl/util.c 2007-11-18 14:16:34.000000000 -0800
@@ -1800,24 +1800,51 @@
#endif /* !HAS_MEMCMP || !HAS_SANE_MEMCMP */

#ifndef HAS_VPRINTF
+/* This vsprintf replacement should generally never get used, since
+ vsprintf was available in both System V and BSD 2.11. (There may
+ be some cross-compilation or embedded set-ups where it is needed,
+ however.)
+
+ If you encounter a problem in this function, it's probably a symptom
+ that Configure failed to detect your system's vprintf() function.
+ See the section on "item vsprintf" in the INSTALL file.
+
+ This version may compile on systems with BSD-ish <stdio.h>,
+ but probably won't on others.
+*/

#ifdef USE_CHAR_VSPRINTF
char *
#else
int
#endif
-vsprintf(char *dest, const char *pat, char *args)
+vsprintf(char *dest, const char *pat, void *args)
{
FILE fakebuf;

+#if defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE)
+ FILE_ptr(&fakebuf) = (STDCHAR *) dest;
+ FILE_cnt(&fakebuf) = 32767;
+#else
+ /* These probably won't compile -- If you really need
+ this, you'll have to figure out some other method. */
fakebuf._ptr = dest;
fakebuf._cnt = 32767;
+#endif
#ifndef _IOSTRG
#define _IOSTRG 0
#endif
fakebuf._flag = _IOWRT|_IOSTRG;
_doprnt(pat, args, &fakebuf); /* what a kludge */
- (void)putc('\0', &fakebuf);
+#if defined(STDIO_PTR_LVALUE)
+ *(FILE_ptr(&fakebuf)++) = '\0';
+#else
+ /* PerlIO has probably #defined away fputc, but we want it here. */
+# ifdef fputc
+# undef fputc /* XXX Should really restore it later */
+# endif
+ (void)fputc('\0', &fakebuf);
+#endif
#ifdef USE_CHAR_VSPRINTF
return(dest);
#else
End of Patch.
Nicholas Clark
2007-11-18 22:45:27 UTC
Permalink
Post by nwc10+ (Nicholas Clark)
[ 31447]
safely handle cloning a stale lexical var
my $x if ...; sub { $x}
could attempt to clone $x even if $x is stale.
No, that one got pulled.

Nicholas Clark

Loading...