[perl.git] branch blead, updated. v5.25.8-208-gfe7df09eec

2017-01-13 Thread Father Chrysostomos
In perl.git, the branch blead has been updated



- Log -
commit fe7df09eecdd7566894f43ed5bb23bdc3074e47e
Author: Father Chrysostomos 
Date:   Thu Jan 12 22:17:04 2017 -0800

[perl #130546] Restore delete-scalar-slice warning

Commit v5.19.3-506-g429a25554a reduced false positives with the annoy-
ing ‘Scalar value such-and-such better written as such-and-such’ warn-
ing by flagging the op in the lexer (instead of warning immediately),
and then checking the op tree later, in order to avoid false positives
with perfectly valid constructs, such as qw"...".

The new code that checked the op tree looked for hslice and aslice
ops, but in the particular case of delete @a{...} and delete @a[...],
the slice op gets nulled and the delete op takes care of the slicing
operation (if you can call it that) itself.  The result was that the
warning disappeared altogether for delete.

This commit makes op.c check also for nulled hslice and aslice ops,
and applies the same heuristics to them as to unnulled slicing ops.
---

Summary of changes:
 op.c  | 10 --
 t/lib/warnings/op |  6 ++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/op.c b/op.c
index 919e8ed514..c213bb684f 100644
--- a/op.c
+++ b/op.c
@@ -1670,10 +1670,12 @@ static void
 S_scalar_slice_warning(pTHX_ const OP *o)
 {
 OP *kid;
+const bool h = o->op_type == OP_HSLICE
+   || (o->op_type == OP_NULL && o->op_targ == OP_HSLICE);
 const char lbrack =
-   o->op_type == OP_HSLICE ? '{' : '[';
+   h ? '{' : '[';
 const char rbrack =
-   o->op_type == OP_HSLICE ? '}' : ']';
+   h ? '}' : ']';
 SV *name;
 SV *keysv = NULL; /* just to silence compiler warnings */
 const char *key = NULL;
@@ -2596,6 +2598,10 @@ S_finalize_op(pTHX_ OP* o)
 S_check_hash_fields_and_hekify(aTHX_ rop, key_op);
break;
 }
+case OP_NULL:
+   if (o->op_targ != OP_HSLICE && o->op_targ != OP_ASLICE)
+   break;
+   /* FALLTHROUGH */
 case OP_ASLICE:
S_scalar_slice_warning(aTHX_ o);
break;
diff --git a/t/lib/warnings/op b/t/lib/warnings/op
index e8d93e8a8c..37ebbbed99 100644
--- a/t/lib/warnings/op
+++ b/t/lib/warnings/op
@@ -167,9 +167,13 @@ use warnings 'syntax' ;
 @a{--$_};
 @a[$_];
 @a[--$_];
+delete @a[$x];
+delete @a{$x};
 no warnings 'syntax' ;
 @a[3];
 @a{3};
+delete @a[$x];
+delete @a{$x};
 EXPECT
 Scalar value @a[3] better written as $a[3] at - line 3.
 Scalar value @a{3} better written as $a{3} at - line 4.
@@ -181,6 +185,8 @@ Scalar value @a{...} better written as $a{...} at - line 9.
 Scalar value @a{...} better written as $a{...} at - line 10.
 Scalar value @a[...] better written as $a[...] at - line 11.
 Scalar value @a[...] better written as $a[...] at - line 12.
+Scalar value @a[...] better written as $a[...] at - line 13.
+Scalar value @a{...} better written as $a{...} at - line 14.
 
 # op.c
 use utf8;

--
Perl5 Master Repository


[perl.git] branch smoke-me/jkeenan/130550-out-of-bounds, updated. v5.25.8-208-g05053e24a6

2017-01-13 Thread James Keenan
In perl.git, the branch smoke-me/jkeenan/130550-out-of-bounds has been updated



  discards  66c236879f3ec022c6458aca4326698c6acf4849 (commit)
- Log -
commit 05053e24a695b87c87fef97f77a2c81fcb01a028
Author: Hanno Böck 
Date:   Fri Jan 13 20:54:40 2017 -0500

Avoid out-of-bounds problem (not yet working).

Add Hanno Böck to AUTHORS.

For: RT #130550
---

Summary of changes:
 AUTHORS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/AUTHORS b/AUTHORS
index 8b530f9ba3..62de716e5e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -476,7 +476,7 @@ H.Merijn Brand  
 Hal Morris 
 Hal Pomeranz   
 Hallvard B Furuseth
-Hanno BÃck hboeck.de
+Hanno Böckhboeck.de
 Hannu Napari   
 Hans de Graaff 
 Hans Dieter Pearcey

--
Perl5 Master Repository


[perl.git] branch smoke-me/jkeenan/130550-out-of-bounds, created. v5.25.8-208-g66c236879f

2017-01-13 Thread James Keenan
In perl.git, the branch smoke-me/jkeenan/130550-out-of-bounds has been created



at  66c236879f3ec022c6458aca4326698c6acf4849 (commit)

- Log -
commit 66c236879f3ec022c6458aca4326698c6acf4849
Author: Hanno Bock 
Date:   Fri Jan 13 20:54:40 2017 -0500

Avoid out-of-bounds problem.

Add Hanno Bock to AUTHORS.

For: RT #130550
---

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.25.8-207-gcbe2fc5001

2017-01-13 Thread Karl Williamson
In perl.git, the branch blead has been updated



- Log -
commit cbe2fc5001aa59cdc73e04cc35e097a2ecfbeec0
Author: Karl Williamson 
Date:   Tue Jan 10 10:31:29 2017 -0700

re.pm: pod formatting nits, and clarifications

M   ext/re/re.pm

commit a4368cc338f9178e7f4861a61ab56710050e50dc
Author: Karl Williamson 
Date:   Thu Jan 5 22:03:35 2017 -0700

Warn on unescaped /[]}]/ under re strict

This commit generates a warning when the experimental 're strict'
feature is in effect for unescaped '}' and ']' characters (in a regular
expression pattern) that are interpreted literally.

This brings the behavior of these more in line with ')' which croaks
when it is taken literally.

The problem with the existing behavior is that these characters may be
metacharacters or they may be literals, depending on action at a
distance.  Not so with ')', which is always a metacharacter unless
escaped.

Ideally, all three of these characters should behave similarly, but it
really is too late for that, except we can warn if the user has
requested extra checking of their patterns with this experimental
're strict' feature.

M   pod/perldelta.pod
M   pod/perldiag.pod
M   regcomp.c
M   t/re/reg_mesg.t

commit b1793c1ad815aa7190b1daead0f0d4fce340aff6
Author: Karl Williamson 
Date:   Thu Jan 5 21:51:12 2017 -0700

t/re/reg_mesg.t: Add new ability

This now allows one to say that a warning message is to be expected if
and only if 'use re "strict"' is on.

M   t/re/reg_mesg.t

commit 92e8e65053b85a7f695f0a1b5270a3567df87863
Author: Karl Williamson 
Date:   Tue Jan 10 11:09:33 2017 -0700

Various .t's: Escape literal '}' and ']' in patterns

It is clearer to show that these characters which are sometimes meta and
sometimes literal are meant to be taken literally here.

M   Porting/sync-with-cpan
M   ext/Devel-Peek/t/Peek.t
M   ext/POSIX/t/posix.t
M   lib/B/Deparse-core.t
M   lib/B/Deparse.pm
M   t/comp/parser.t
M   t/op/attrs.t
M   t/op/coreamp.t
M   t/op/taint.t
M   t/op/tr.t
M   t/re/anyof.t
M   t/re/pat_advanced.t
M   t/re/re_tests
M   t/uni/attrs.t
M   t/uni/gv.t

commit 75ea5c6c82d3602be563bf9c72e8b8e2c711225b
Author: Karl Williamson 
Date:   Thu Jan 5 19:28:38 2017 -0700

regcomp.c: Clarify comment.

M   regcomp.c
---

Summary of changes:
 Porting/sync-with-cpan  |  2 +-
 ext/Devel-Peek/t/Peek.t |  2 +-
 ext/POSIX/t/posix.t |  2 +-
 ext/re/re.pm| 37 +
 lib/B/Deparse-core.t|  2 +-
 lib/B/Deparse.pm|  4 ++--
 pod/perldelta.pod   | 16 
 pod/perldiag.pod| 20 
 regcomp.c   |  8 +++-
 t/comp/parser.t |  2 +-
 t/op/attrs.t|  2 +-
 t/op/coreamp.t  |  8 
 t/op/taint.t| 16 
 t/op/tr.t   |  4 ++--
 t/re/anyof.t|  4 ++--
 t/re/pat_advanced.t |  2 +-
 t/re/re_tests   |  4 ++--
 t/re/reg_mesg.t | 43 ++-
 t/uni/attrs.t   |  2 +-
 t/uni/gv.t  |  4 ++--
 20 files changed, 132 insertions(+), 52 deletions(-)

diff --git a/Porting/sync-with-cpan b/Porting/sync-with-cpan
index 9c6a6b02d2..8245e5cd66 100755
--- a/Porting/sync-with-cpan
+++ b/Porting/sync-with-cpan
@@ -613,7 +613,7 @@ while (<$Maintainers_pl>) {
 }
 }
 
-if (/^}/) {
+if (/^\}/) {
 $in_mod_section = 0;
 }
 }
diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t
index d62e3b21a1..4775c1c64f 100644
--- a/ext/Devel-Peek/t/Peek.t
+++ b/ext/Devel-Peek/t/Peek.t
@@ -77,7 +77,7 @@ sub do_test {
# Could do this is in a s///mge but seems clearer like this:
$pattern = join '', map {
# If we identify the version condition, take *it* out whatever
-   s/\s*# (\$].*)$//
+   s/\s*# (\$\].*)$//
? (eval $1 ? $_ : '')
: $_ # Didn't match, so this line is in
} split /^/, $pattern;
diff --git a/ext/POSIX/t/posix.t b/ext/POSIX/t/posix.t
index ea43bc08ad..7b456c1b04 100644
--- a/ext/POSIX/t/posix.t
+++ b/ext/POSIX/t/posix.t
@@ -155,7 +155,7 @@ if ( $unix_mode ) {
 $pat = qr#[\\/]POSIX$#i;
 }
 else {
-$pat = qr/\.POSIX]/i;
+$pat = qr/\.POSIX\]/i;
 }
 like( getcwd(), qr/$pat/, 'getcwd' );
 
diff --git a/ext/re/re.pm b/ext/re/re.pm
index 123408c76f..c416b94c28 100644
--- a/ext/re/re.pm
+++ b/ext/re/re.pm
@@ -332,7 +332,7 @@ re - Perl pragma 

[perl.git] branch blead, updated. v5.25.8-202-g77c8f26370

2017-01-13 Thread Karl Williamson
In perl.git, the branch blead has been updated



- Log -
commit 77c8f26370dcc0e16ca7c5f1b8f3bd1b99a57a28
Author: Karl Williamson 
Date:   Thu Jan 12 11:07:47 2017 -0700

Add /xx regex pattern modifier

This was first proposed in the thread starting at
http://www.nntp.perl.org/group/perl.perl5.porters/2014/09/msg219394.html

M   MANIFEST
M   ext/re/re.pm
M   ext/re/t/reflags.t
M   pod/perlcheat.pod
M   pod/perldelta.pod
M   pod/perldiag.pod
M   pod/perlop.pod
M   pod/perlre.pod
M   pod/perlrecharclass.pod
M   pod/perlretut.pod
M   pod/perlstyle.pod
M   pod/perluniintro.pod
M   regcomp.c
M   regexp.h
A   t/re/keep_tabs.t
M   t/re/re_tests
M   t/re/reg_mesg.t
M   toke.c

commit 2ab076704905c338cc874079818784698cd5bc85
Author: Karl Williamson 
Date:   Fri Jan 13 11:17:25 2017 -0700

perlre: Clarifications, typos

M   pod/perlre.pod

commit 563642b4907d9b1b6beaa96b472ae787ae81d56f
Author: Karl Williamson 
Date:   Tue Jan 10 19:10:58 2017 -0700

perlretut: Add some white space for legibility

M   pod/perlretut.pod

commit fc54a9b2090b5f71905241c319706e3cca18acc9
Author: Karl Williamson 
Date:   Wed Jan 11 22:18:53 2017 -0700

regcomp.c: Remove obsolete data structure element

This was used for the removed feature of having the source in a
different encoding.

M   regcomp.c

commit af4226f2469589e84d382a08a6a5242303758f0b
Author: Karl Williamson 
Date:   Thu Jan 12 21:05:35 2017 -0700

pp_sys.c: White space only

Vertically align some components of an 'if' for readability.

M   pp_sys.c
---

Summary of changes:
 MANIFEST|  1 +
 ext/re/re.pm| 23 ++-
 ext/re/t/reflags.t  | 17 ---
 pod/perlcheat.pod   |  2 +-
 pod/perldelta.pod   |  9 +-
 pod/perldiag.pod|  8 -
 pod/perlop.pod  |  4 ++-
 pod/perlre.pod  | 77 -
 pod/perlrecharclass.pod | 38 
 pod/perlretut.pod   | 30 +++
 pod/perlstyle.pod   |  5 ++--
 pod/perluniintro.pod|  2 +-
 pp_sys.c| 10 +++
 regcomp.c   | 33 -
 regexp.h| 14 +++--
 t/re/keep_tabs.t| 29 +++
 t/re/re_tests   | 12 
 t/re/reg_mesg.t |  8 ++---
 toke.c  |  8 -
 19 files changed, 245 insertions(+), 85 deletions(-)
 create mode 100644 t/re/keep_tabs.t

diff --git a/MANIFEST b/MANIFEST
index d31ee1a8ed..4745b04ede 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -5726,6 +5726,7 @@ t/porting/utils.t Check that utility scripts 
still compile
 t/re/anyof.t   See if bracketed char classes [...] compile 
properly
 t/re/charset.t See if regex modifiers like /d, /u work properly
 t/re/fold_grind.t  See if case folding works properly
+t/re/keep_tabs.t   Tests where \t can't be expanded.
 t/re/no_utf8_pm.t  Verify utf8.pm doesn't get loaded unless 
required
 t/re/overload.tTest against string corruption in pattern 
matches on overloaded objects
 t/re/pat.t See if esoteric patterns work
diff --git a/ext/re/re.pm b/ext/re/re.pm
index b924fd9fc7..123408c76f 100644
--- a/ext/re/re.pm
+++ b/ext/re/re.pm
@@ -4,7 +4,7 @@ package re;
 use strict;
 use warnings;
 
-our $VERSION = "0.33";
+our $VERSION = "0.34";
 our @ISA = qw(Exporter);
 our @EXPORT_OK   = ('regmust',
 qw(is_regexp regexp_pattern
@@ -23,6 +23,7 @@ my %reflags = (
 s => 1 << ($PMMOD_SHIFT + 1),
 i => 1 << ($PMMOD_SHIFT + 2),
 x => 1 << ($PMMOD_SHIFT + 3),
+   xx => 1 << ($PMMOD_SHIFT + 4),
 n => 1 << ($PMMOD_SHIFT + 5),
 p => 1 << ($PMMOD_SHIFT + 6),
 strict => 1 << ($PMMOD_SHIFT + 10),
@@ -112,7 +113,6 @@ sub bits {
 my $on = shift;
 my $bits = 0;
 my $turning_all_off = ! @_ && ! $on;
-my %seen;   # Has flag already been seen?
 if ($turning_all_off) {
 
 # Pretend were called with certain parameters, which are best dealt
@@ -180,6 +180,7 @@ sub bits {
} elsif ($s =~ s/^\///) {
my $reflags = $^H{reflags} || 0;
my $seen_charset;
+my $x_count = 0;
while ($s =~ m/( . )/gx) {
 local $_ = $1;
if (/[adul]/) {
@@ -225,7 +226,19 @@ sub bits {
 && $^H{reflags_charset} == 
$reflags{$_};
}
} elsif (exists $reflags{$_}) {
-$seen{$_}++;
+if ($_ eq 'x') {
+ 

[perl.git] branch smoke-me/jkeenan/77934-threads, deleted. v5.25.8-197-g2798a01956

2017-01-13 Thread James Keenan
In perl.git, the branch smoke-me/jkeenan/77934-threads has been deleted



   was  2798a0195639a49658cb716c479950bacb5d522e

---
2798a0195639a49658cb716c479950bacb5d522e Write tests for RT #77934.
---

--
Perl5 Master Repository


[perl.git] branch blead, updated. v5.25.8-197-gafa4768ac9

2017-01-13 Thread James Keenan
In perl.git, the branch blead has been updated



- Log -
commit afa4768ac90fcd6a53a3661885a238d344a02f92
Author: James E Keenan 
Date:   Thu Jan 12 17:15:30 2017 -0500

Write tests for RT #77934.

Assistance with test provided by Jerry Hedden.
---

Summary of changes:
 MANIFEST   |   1 +
 dist/threads/t/kill3.t | 113 +
 2 files changed, 114 insertions(+)
 create mode 100644 dist/threads/t/kill3.t

diff --git a/MANIFEST b/MANIFEST
index b0197df363..d31ee1a8ed 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3689,6 +3689,7 @@ dist/threads/t/free2.tMore ithread 
destruction tests
 dist/threads/t/join.t  Testing the join function
 dist/threads/t/kill.t  Tests thread signalling
 dist/threads/t/kill2.t Tests thread signalling
+dist/threads/t/kill3.t Tests thread signalling
 dist/threads/t/libc.t  testing libc functions for threadsafety
 dist/threads/t/list.t  Test threads->list()
 dist/threads/t/no_threads.tthreads test for non-threaded Perls
diff --git a/dist/threads/t/kill3.t b/dist/threads/t/kill3.t
new file mode 100644
index 00..15e3f1690f
--- /dev/null
+++ b/dist/threads/t/kill3.t
@@ -0,0 +1,113 @@
+use strict;
+use warnings;
+
+BEGIN {
+require($ENV{PERL_CORE} ? '../../t/test.pl' : './t/test.pl');
+
+use Config;
+if (! $Config{'useithreads'}) {
+skip_all(q/Perl not compiled with 'useithreads'/);
+}
+}
+
+use ExtUtils::testlib;
+use Cwd;
+my $cwd = cwd();
+
+use threads;
+
+BEGIN {
+if (! eval 'use threads::shared; 1') {
+skip_all('threads::shared not available');
+}
+
+local $SIG{'HUP'} = sub {};
+my $thr = threads->create(sub {});
+eval { $thr->kill('HUP') };
+$thr->join();
+if ($@ && $@ =~ /safe signals/) {
+skip_all('Not using safe signals');
+}
+
+plan(2);
+};
+
+{
+$SIG{'KILL'} = undef;
+chdir '/tmp';
+mkdir "toberead$$";
+chdir "toberead$$";
+for ('a'..'e') {
+open my $THING, ">$_";
+close $THING or die "$_: $!";
+}
+chdir $cwd;
+
+local $ARGV[0] = undef;
+fresh_perl_is(<<'EOI', 'ok', { }, 'RT #77934: Case: Perl-false $ARGV[0]');
+local $@;
+my $DIRH;
+my $thr;
+$thr = async {
+# Thread 'cancellation' signal handler
+$SIG{'KILL'} = sub { threads->exit(); };
+
+opendir $DIRH, ".";
+my $start = telldir $DIRH;
+while (1) {
+readdir $DIRH or seekdir $DIRH, 0;
+}
+} if $ARGV[0];
+
+opendir $DIRH, ".";
+for(1..5) {
+select undef, undef, undef, .25;
+}
+
+if ($ARGV[0]) {
+$thr->kill('KILL')->detach();
+}
+print($@ ? 'not ok' : 'ok');
+EOI
+}
+
+{
+$SIG{'KILL'} = undef;
+chdir '/tmp';
+mkdir "shouldberead$$";
+chdir "shouldberead$$";
+for ('a'..'e') {
+open my $THING, ">$_";
+close $THING or die "$_: $!";
+}
+chdir $cwd;
+
+local $ARGV[0] = 1;
+fresh_perl_is(<<'EOI', 'ok', { }, 'RT #77934: Case: Perl-true  $ARGV[0]');
+local $@;
+my $DIRH;
+my $thr;
+$thr = async {
+# Thread 'cancellation' signal handler
+$SIG{'KILL'} = sub { threads->exit(); };
+
+opendir $DIRH, ".";
+my $start = telldir $DIRH;
+while (1) {
+readdir $DIRH or seekdir $DIRH, 0;
+}
+} if $ARGV[0];
+
+opendir $DIRH, ".";
+for(1..5) {
+select undef, undef, undef, .25;
+}
+
+if ($ARGV[0]) {
+$thr->kill('KILL')->detach();
+}
+print($@ ? 'not ok' : 'ok');
+EOI
+}
+
+exit(0);

--
Perl5 Master Repository