Skip to content

Commit c15560a

Browse files
authored
Merge branch 'Perl:blead' into perlop_xor
2 parents 99824bd + 21e059f commit c15560a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1146
-1714
lines changed

Configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16755,6 +16755,11 @@ define:define:?*)
1675516755
;;
1675616756
esac
1675716757

16758+
if test $ivsize -lt $ptrsize; then
16759+
echo "Re-run Configure adding -Duse64bitint so as to make integers as large as pointer values" >&4
16760+
exit 1
16761+
fi
16762+
1675816763
case "$uselongdouble:$d_longdbl" in
1675916764
define:define)
1676016765
nvtype="long double"

Porting/Maintainers.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ package Maintainers;
528528
},
529529

530530
'ExtUtils::ParseXS' => {
531-
'DISTRIBUTION' => 'LEONT/ExtUtils-ParseXS-3.51.tar.gz',
531+
'DISTRIBUTION' => 'LEONT/ExtUtils-ParseXS-3.57.tar.gz',
532532
'FILES' => q[dist/ExtUtils-ParseXS],
533533
},
534534

lib/B/Deparse.pm

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# This is based on the module of the same name by Malcolm Beattie,
88
# but essentially none of his code remains.
99

10-
package B::Deparse 1.84;
10+
package B::Deparse 1.85;
1111
use strict;
1212
use Carp;
1313
use B qw(class main_root main_start main_cv svref_2object opnumber perlstring
@@ -3318,9 +3318,16 @@ sub pp_and { logop(@_, "and", 3, "&&", 11, "if") }
33183318
sub pp_or { logop(@_, "or", 2, "||", 10, "unless") }
33193319
sub pp_dor { logop(@_, "//", 10) }
33203320

3321-
# xor is syntactically a logop, but it's really a binop (contrary to
3322-
# old versions of opcode.pl). Syntax is what matters here.
3323-
sub pp_xor { logop(@_, "xor", 2, "^^", 10, "") }
3321+
sub pp_xor {
3322+
my $self = shift;
3323+
my ($op, $cx) = @_;
3324+
if ($cx > 2 or $op->flags & OPf_STACKED) {
3325+
binop($self, @_, "^^", 10, ASSIGN);
3326+
}
3327+
else {
3328+
binop($self, @_, "xor", 2);
3329+
}
3330+
}
33243331

33253332
sub logassignop {
33263333
my $self = shift;

lib/B/Deparse.t

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3450,3 +3450,8 @@ $_ = (!$p) isa 'Some::Class';
34503450
$_ = (!$p) =~ tr/1//;
34513451
$_ = (!$p) =~ /1/;
34523452
$_ = (!$p) =~ s/1//r;
3453+
####
3454+
# xor operator
3455+
my($x, $y, $z);
3456+
$z = 1 + ($x ^^ $y);
3457+
$z = ($x ^^= $y);

lib/Thread.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use strict;
44
use warnings;
55
no warnings 'redefine';
66

7-
our $VERSION = '3.05';
7+
our $VERSION = '3.06';
88
$VERSION = eval $VERSION;
99

1010
BEGIN {
@@ -61,7 +61,7 @@ In Perl 5.005, the thread model was that all data is implicitly shared, and
6161
shared access to data has to be explicitly synchronized. This model is called
6262
I<5005threads>.
6363
64-
In Perl 5.6, a new model was introduced in which all is was thread local and
64+
In Perl 5.6, a new model was introduced in which all data is thread local and
6565
shared access to data has to be explicitly declared. This model is called
6666
I<ithreads>, for "interpreter threads".
6767

lib/builtin.pm

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package builtin 0.018;
1+
package builtin 0.019;
22

33
use v5.40;
44

@@ -43,6 +43,10 @@ can be requested for convenience.
4343
Individual named functions can be imported by listing them as import
4444
parameters on the C<use> statement for this pragma.
4545
46+
The L<builtin::compat> module from CPAN provides versions of many of these
47+
functions that can be used on Perl versions where C<builtin> or specific
48+
functions are not yet available.
49+
4650
B<Warning>: At present, many of the functions in the C<builtin> namespace are
4751
experimental. Calling them will trigger warnings of the
4852
C<experimental::builtin> category.
@@ -414,15 +418,12 @@ A complete list is in L<perlrecharclass/Whitespace>.
414418
415419
C<trim> is equivalent to:
416420
417-
$str =~ s/\A\s+|\s+\z//urg;
421+
my $trimmed = $str =~ s/\A\s+//ur =~ s/\s+\z//ur;
418422
419423
Available starting with Perl 5.36. Since Perl 5.40, it is no longer
420424
experimental and it is included in the 5.40 and higher builtin version
421425
bundles.
422426
423-
For Perl versions where this function is not available look at the
424-
L<String::Util> module for a comparable implementation.
425-
426427
=head2 is_tainted
427428
428429
$bool = is_tainted($var);
@@ -487,4 +488,4 @@ Available starting with Perl 5.40.
487488
488489
=head1 SEE ALSO
489490
490-
L<perlop>, L<perlfunc>, L<Scalar::Util>
491+
L<perlop>, L<perlfunc>, L<Scalar::Util>, L<builtin::compat>

lib/strict.pm

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package strict;
22

3-
$strict::VERSION = "1.13";
3+
$strict::VERSION = "1.14";
44

55
my ( %bitmask, %explicit_bitmask );
66

@@ -12,12 +12,15 @@ BEGIN {
1212
if __FILE__ !~ ( '(?x) \b '.__PACKAGE__.' \.pmc? \z' )
1313
&& __FILE__ =~ ( '(?x) \b (?i:'.__PACKAGE__.') \.pmc? \z' );
1414

15+
# which strictures are actually in force
1516
%bitmask = (
1617
refs => 0x00000002,
1718
subs => 0x00000200,
1819
vars => 0x00000400,
1920
);
2021

22+
# which strictures have at some point been turned on or off explicitly
23+
# and must therefore not be touched by any subsequent `use VERSION` or `no VERSION`
2124
%explicit_bitmask = (
2225
refs => 0x00000020,
2326
subs => 0x00000040,
@@ -38,12 +41,12 @@ BEGIN {
3841
}
3942

4043
sub bits {
44+
my $do_explicit = caller eq __PACKAGE__;
4145
my $bits = 0;
4246
my @wrong;
4347
foreach my $s (@_) {
4448
if (exists $bitmask{$s}) {
45-
$^H |= $explicit_bitmask{$s};
46-
49+
$bits |= $explicit_bitmask{$s} if $do_explicit;
4750
$bits |= $bitmask{$s};
4851
}
4952
else {
@@ -66,7 +69,9 @@ sub unimport {
6669
shift;
6770

6871
if (@_) {
69-
$^H &= ~&bits;
72+
my $bits = &bits;
73+
$^H &= ~$bits;
74+
$^H |= all_explicit_bits & $bits;
7075
}
7176
else {
7277
$^H &= ~all_bits;
@@ -75,6 +80,7 @@ sub unimport {
7580
}
7681

7782
1;
83+
7884
__END__
7985
8086
=head1 NAME

metaconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
* HAS_OPENAT
6262
* HAS_PRCTL
6363
* HAS_PSEUDOFORK
64+
* HAS_PTRDIFF_T
6465
* HAS_RANDOM_R
6566
* HAS_SIGINFO_SI_VALUE
6667
* HAS_SIGSETJMP

op.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3230,6 +3230,7 @@ Perl_op_lvalue_flags(pTHX_ OP *o, I32 type, U32 flags)
32303230
case OP_I_MODULO:
32313231
case OP_I_ADD:
32323232
case OP_I_SUBTRACT:
3233+
case OP_XOR:
32333234
if (!(o->op_flags & OPf_STACKED))
32343235
goto nomod;
32353236
PL_modcount++;

pod/perldebguts.pod

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ Perl inserts the contents of C<$ENV{PERL5DB}> (or C<BEGIN {require
3434

3535
=item *
3636

37+
If the C<-dt> switch is supplied, C<PERL5DB_THREADED=1> is set in the
38+
environment. C<perl5db.pl> or your custom debugger can use this to
39+
enable threading support.
40+
41+
=item *
42+
3743
Each array C<@{"_<$filename"}> holds the lines of $filename for a
3844
file compiled by Perl. The same is also true for C<eval>ed strings
3945
that contain subroutines, or which are currently being executed.

0 commit comments

Comments
 (0)