This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
8 years agot/op/crypt.t: Perform SHA-256 algorithm if default one is disabled
Petr Písař [Mon, 7 Apr 2014 10:31:28 +0000 (12:31 +0200)]
t/op/crypt.t: Perform SHA-256 algorithm if default one is disabled

The crypt(3) call may return NULL. This is the case on FIPS-enabled
platforms. Then "salt makes a difference" test would fail.

This fixes RT#121591.

Signed-off-by: Petr Písař <ppisar@redhat.com>
8 years agoperldelta for 2c2d7daa9519, a6d695237c4c
Tony Cook [Thu, 9 Oct 2014 00:59:55 +0000 (11:59 +1100)]
perldelta for 2c2d7daa9519a6d695237c4c

8 years ago[perl #122445] use magic on $DB::single etc to avoid overload issues
Tony Cook [Thu, 2 Oct 2014 05:54:58 +0000 (15:54 +1000)]
[perl #122445] use magic on $DB::single etc to avoid overload issues

This prevents perl recursing infinitely when an overloaded object is
assigned to $DB::single, $DB::trace or $DB::signal

This is done by referencing their values as IVs instead of as SVs in
dbstate, and by adding magic to those variables so that assignments to
the scalars update the PL_DBcontrol array.

8 years ago[perl #122445] test for overload assigned to $DB::single
Tony Cook [Thu, 14 Aug 2014 01:09:10 +0000 (11:09 +1000)]
[perl #122445] test for overload assigned to $DB::single

8 years agoSpecial test preambles needed for these.
Jarkko Hietaniemi [Wed, 8 Oct 2014 21:58:54 +0000 (23:58 +0200)]
Special test preambles needed for these.

8 years agopod_rules.t needs special preamble.
Jarkko Hietaniemi [Wed, 8 Oct 2014 21:47:20 +0000 (23:47 +0200)]
pod_rules.t needs special preamble.

8 years agoVersion bump for e6425454.
Jarkko Hietaniemi [Wed, 8 Oct 2014 21:34:00 +0000 (23:34 +0200)]
Version bump for e6425454.

8 years agoTest preamble: explicit @INC, instead of unshift.
Jarkko Hietaniemi [Wed, 8 Oct 2014 21:12:16 +0000 (23:12 +0200)]
Test preamble: explicit @INC, instead of unshift.

Exception: t/run/switchI.t, needs the unshift way.

8 years agoTest preamble: if requiring ./test.pl, needs chdir.
Jarkko Hietaniemi [Fri, 26 Sep 2014 01:02:08 +0000 (21:02 -0400)]
Test preamble: if requiring ./test.pl, needs chdir.

Exception: t/op/chdir, which does things its own way, for obvious reasons.

8 years agoTest preamble: unify to dot slash test dot pl
Jarkko Hietaniemi [Fri, 26 Sep 2014 00:58:56 +0000 (20:58 -0400)]
Test preamble: unify to dot slash test dot pl

8 years agoTest preamble: unify chdir 't' if -d 't';
Jarkko Hietaniemi [Fri, 26 Sep 2014 00:53:35 +0000 (20:53 -0400)]
Test preamble: unify chdir 't' if -d 't';

8 years agoAdd various *BSD O_ constants.
Jarkko Hietaniemi [Wed, 8 Oct 2014 19:08:54 +0000 (21:08 +0200)]
Add various *BSD O_ constants.

8 years agoTru64: the socket API defines must come early.
Jarkko Hietaniemi [Wed, 8 Oct 2014 06:40:21 +0000 (08:40 +0200)]
Tru64: the socket API defines must come early.

There seems to be no way around needing to select the socket API early.

8 years agoattrs.t: Test that attr handlers can see prototypes
Father Chrysostomos [Wed, 8 Oct 2014 15:29:04 +0000 (08:29 -0700)]
attrs.t: Test that attr handlers can see prototypes

8 years agoperldelta for ff5314c5aa54
Tony Cook [Tue, 7 Oct 2014 23:37:34 +0000 (10:37 +1100)]
perldelta for ff5314c5aa54

8 years agofix attributes memcmp without len<6 (asan catch)
Reini Urban [Tue, 7 Oct 2014 04:44:27 +0000 (15:44 +1100)]
fix attributes memcmp without len<6 (asan catch)

8 years agoTru64: does have sa_len.
Jarkko Hietaniemi [Tue, 7 Oct 2014 20:20:28 +0000 (22:20 +0200)]
Tru64: does have sa_len.

8 years agoTru64: _SOCKADDR_LEN is good.
Jarkko Hietaniemi [Tue, 7 Oct 2014 20:21:54 +0000 (22:21 +0200)]
Tru64: _SOCKADDR_LEN is good.

Declare it as early as possible.  The earlier position lead into
getting a mix of different APIs with mismatching sockadddrs.

8 years agot/io/eintr.t: Make this pass on my ppc64 box
Ævar Arnfjörð Bjarmason [Tue, 7 Oct 2014 19:57:59 +0000 (19:57 +0000)]
t/io/eintr.t: Make this pass on my ppc64 box

See the "Test failures in blead on ppc64" thread on perl5-porters for
details. I'd fail on the previous value, this passes every time.

8 years agoTru64: the cluster filesystem is special.
Jarkko Hietaniemi [Tue, 7 Oct 2014 18:28:20 +0000 (20:28 +0200)]
Tru64: the cluster filesystem is special.

(It has non-POSIX interfaces and semantics which probably should
 be left outside e.g. Cwd::realpath()).

8 years agoTru64: Document "read_cur_obj_info: bad file magic number" error.
Jarkko Hietaniemi [Mon, 6 Oct 2014 21:34:56 +0000 (23:34 +0200)]
Tru64: Document "read_cur_obj_info: bad file magic number" error.

8 years agoSkip the test if in linux but not in x86*.
Jarkko Hietaniemi [Tue, 7 Oct 2014 06:49:02 +0000 (08:49 +0200)]
Skip the test if in linux but not in x86*.

The state of things found by Ævar in ppc linux was even weirder:
most -- but not all! -- text symbols were in D section, not in T.

Skipping is fine since we are here after best-effort testing,
failing softly is quite acceptable.

8 years agoThe double-double precision can be really large.
Jarkko Hietaniemi [Tue, 7 Oct 2014 06:35:04 +0000 (08:35 +0200)]
The double-double precision can be really large.

I don't know where I had pulled the earlier smaller limit,
but sisyphus@ set me right.

8 years agoFix EBCDIC-only bug with /[...]/
Karl Williamson [Mon, 6 Oct 2014 22:13:31 +0000 (16:13 -0600)]
Fix EBCDIC-only bug with /[...]/

Perl has special handling with ranges in bracketed character classes
when the end points are either both uppercase or both lowercase.  This
used a different test which is incorrect.  The consequences were that a
some Latin1 ranges would be rendered as empty.

8 years agoregcomp.c: Fix EBCDIC-only memory leak
Karl Williamson [Mon, 6 Oct 2014 20:55:38 +0000 (14:55 -0600)]
regcomp.c: Fix EBCDIC-only memory leak

8 years agoregcomp.c: Fix typo in comment
Karl Williamson [Mon, 6 Oct 2014 20:55:00 +0000 (14:55 -0600)]
regcomp.c: Fix typo in comment

8 years agoDocument special EBCDIC [...] literal range handling
Karl Williamson [Mon, 6 Oct 2014 18:14:36 +0000 (12:14 -0600)]
Document special EBCDIC [...] literal range handling

8 years ago\N{...} now treated as literal for EBCDIC qr/[...]/
Karl Williamson [Mon, 6 Oct 2014 18:02:25 +0000 (12:02 -0600)]
\N{...} now treated as literal for EBCDIC qr/[...]/

Perl specially handles some ranges in bracketed character classes to
deal with gaps between, for example, "i" and "j".  The next commit will
better document this.  This special handling is only invoked when both
ends of the range are literals.  This commit extends that so that a
\N{...} construct is considered a literal for this purpose.

There really shouldn't be any difference in the handling of "A" vs
"\N{LATIN CAPITAL LETTER A}".  And this commit makes them be handled the
same.

It further makes \N{U+0041} be treated the same.  The programmer here is
effectively saying "A", and invoking the Unicode definition for it, so
it stands to reason that the range s/he wants should also be interpreted
the Unicode way.

8 years agore/pat.t: Add some EBCDIC tests
Karl Williamson [Mon, 6 Oct 2014 17:49:00 +0000 (11:49 -0600)]
re/pat.t: Add some EBCDIC tests

These test the special handling of ranges in bracketed character classes
where the endpoints are alphanumeric literals, but there is a code point
gap in the range that would otherwise match but shouldn't.

8 years agotoke.c: Extract into a named string constant
Karl Williamson [Sat, 4 Oct 2014 17:13:45 +0000 (11:13 -0600)]
toke.c: Extract into a named string constant

This moves a literal double-quoted string into a const variable, so that
it only need be written out once, and its  size can be compiler-computed
and used as another const variable.  Hence, mnemonics are used instead
of bare numbers.

8 years agotoke.c: Update, clarify comments, fix some indents
Karl Williamson [Sat, 4 Oct 2014 16:09:46 +0000 (10:09 -0600)]
toke.c: Update, clarify comments, fix some indents

8 years agoreg_mesg.t: Add comments; remove trailing white-space
Karl Williamson [Fri, 3 Oct 2014 04:46:31 +0000 (22:46 -0600)]
reg_mesg.t: Add comments; remove trailing white-space

8 years agoperlapi: Clarify two entries
Karl Williamson [Thu, 2 Oct 2014 03:00:28 +0000 (21:00 -0600)]
perlapi: Clarify two entries

8 years agoimprove and reword README.win32
Daniel Dragan [Tue, 7 Oct 2014 06:47:15 +0000 (02:47 -0400)]
improve and reword README.win32

8 years agofix op/infnan.t failures on VC 6
Daniel Dragan [Tue, 7 Oct 2014 05:44:44 +0000 (01:44 -0400)]
fix op/infnan.t failures on VC 6

fixes 2 failures, first is a fatal error, sceond is a not ok
-----
ok 460 - abs(NaN) is NaN
ok 461 - int(NaN) is NaN
Can't take sqrt of NaN at op/infnan.t line 319.
C:\perl521\srcvc6\t>
-----
ok 465 - sin(NaN) is NaN
not ok 466 - rand(NaN) is NaN
# Failed test 466 - rand(NaN) is NaN at op/infnan.t line 331
#      got "0.20653527722801"
# expected "NaN"
ok 467 - sin(9**9**9) is NaN
-----

8 years agoMollify concise-xs.t
Father Chrysostomos [Tue, 7 Oct 2014 05:10:40 +0000 (22:10 -0700)]
Mollify concise-xs.t

8 years agoDeparse foreach state $x
Father Chrysostomos [Tue, 7 Oct 2014 04:59:16 +0000 (21:59 -0700)]
Deparse foreach state $x

B::Deparse was emitting ‘foreach my’ instead of ‘foreach state’.

This example prints 1:

use feature ':all'; no warnings experimental;
sub f {
  my sub foo;
  foo(), return if @_;
  for state $x (1) {
    f(1);
    sub foo { print $x, "\n" }
  }
}
f()

If you change ‘state’ to ‘my’, it prints nothing.

So there is a difference between ‘for my’ and ‘for state’.  (At first
I thought there might not be.)

8 years agoDeparse.t: Delete a test
Father Chrysostomos [Tue, 7 Oct 2014 03:39:12 +0000 (20:39 -0700)]
Deparse.t: Delete a test

It was identical to one 3 tests earlier.

8 years agoop_reg_common.h: Nits
Karl Williamson [Mon, 29 Sep 2014 18:41:42 +0000 (12:41 -0600)]
op_reg_common.h: Nits

Add missing U suffix to unsigned numeric constant; parenthesize macro
expansions for safety.

8 years agoFinish deparsing ‘my sub if; CORE::if...’
Father Chrysostomos [Tue, 7 Oct 2014 01:46:54 +0000 (18:46 -0700)]
Finish deparsing ‘my sub if; CORE::if...’

Commit 3188a8216 took care of the majority of cases making mostly gen-
eral changes.

This commit finishes up all the weird keywords that need spe-
cial handling.

8 years agopodcheck.
Jarkko Hietaniemi [Mon, 6 Oct 2014 21:04:12 +0000 (23:04 +0200)]
podcheck.

8 years agoThe double-double mantissa precision ... it's complicated.
Jarkko Hietaniemi [Mon, 6 Oct 2014 19:36:04 +0000 (21:36 +0200)]
The double-double mantissa precision ... it's complicated.

8 years agoAIX/longdouble: switch the default to allow it.
Jarkko Hietaniemi [Mon, 6 Oct 2014 19:27:28 +0000 (21:27 +0200)]
AIX/longdouble: switch the default to allow it.

Since the only really unfixable part is the inf/nan support.

Document the troublesomeness in README.aix.

8 years agoDelete obsolete comment fragment.
Jarkko Hietaniemi [Mon, 6 Oct 2014 18:36:29 +0000 (20:36 +0200)]
Delete obsolete comment fragment.

8 years agoUse the double-double size only if using long double.
Jarkko Hietaniemi [Mon, 6 Oct 2014 18:33:32 +0000 (20:33 +0200)]
Use the double-double size only if using long double.

... and only for the buffer size, not for the extraction.

8 years agoThe leading underscore is optional in Darwin.
Jarkko Hietaniemi [Mon, 6 Oct 2014 18:02:14 +0000 (20:02 +0200)]
The leading underscore is optional in Darwin.

8 years agoBail out if there seem to be no text symbols.
Jarkko Hietaniemi [Mon, 6 Oct 2014 17:55:38 +0000 (19:55 +0200)]
Bail out if there seem to be no text symbols.

Found by Ævar in an IBM pSeries POWER7 Fedora Linux box.
All the text symbols (code) seemed to be 'D' (data).

There might be something further to fix regarding the use of 'nm'
(or maybe 'ar'?) in this particular box, but this change makes
the test more robust against surprising nm results.

8 years agoDeparse sub calls quietly
Father Chrysostomos [Mon, 6 Oct 2014 15:28:40 +0000 (08:28 -0700)]
Deparse sub calls quietly

In commit a958cfbb8 I used eval{prototype "CORE::..."} to see whether
something is a keyword, not realising that we have a __DIE__ hand-
ler that squeaks every time.  It is only installed when Deparse is
invoked via -MO.

Localising $SIG{__DIE__} does the trick.  Localising $@ as well is a
good idea when using eval, though I haven’t checked whether that was
causing problems.

8 years ago[perl #122911] regexp.h: Rmv VOL from op_comp sig
Father Chrysostomos [Mon, 6 Oct 2014 13:06:51 +0000 (06:06 -0700)]
[perl #122911] regexp.h: Rmv VOL from op_comp sig

It is no longer needed as of 1067df30ae9.

8 years agosilence some compiler warnings on VC6
Daniel Dragan [Mon, 6 Oct 2014 08:04:05 +0000 (04:04 -0400)]
silence some compiler warnings on VC6

sv.c and toke.c have the following warnings on VC6 but not VC 2003
(and probably newer too), example
..\toke.c(3149) : warning C4761: integral size mismatch in argument;
conversion supplied

find_default_stash (commit 90aeefb473 )& gv_magicalize (commit 71c35c050e )
..\gv.c(1680) : warning C4028: formal parameter 6 different from declaration
..\gv.c(1783) : warning C4028: formal parameter 6 different from declaration

not all VC6 compiler warnings are fixed by this patch

8 years agoDeparse with CORE:: to avoid lex sub conflicts
Father Chrysostomos [Mon, 6 Oct 2014 05:32:23 +0000 (22:32 -0700)]
Deparse with CORE:: to avoid lex sub conflicts

If a lexical sub with the same name as a keyword is in scope, we need
to deparse the keyword with a CORE:: prefix.

This commit handles most of the cases, but there are a few exceptional
cases remaining.

8 years agoDeparse-core.t: Fix ineffective tests
Father Chrysostomos [Mon, 6 Oct 2014 00:30:59 +0000 (17:30 -0700)]
Deparse-core.t: Fix ineffective tests

In a958cfbb8, I accidentally changed this to test ‘test::foo()’,
rather than ‘foo()’ deparsing as ‘test::foo()’, which was what I
had intended.

8 years agoCorrect ‘"my" variable "&f::b"...’ message
Father Chrysostomos [Mon, 6 Oct 2014 00:25:57 +0000 (17:25 -0700)]
Correct ‘"my" variable "&f::b"...’ message

"my" variable &foo::bar can't be in a package at - line 2, near "my sub foo::bar"

It should say ‘subroutine’, not ‘variable’.  When I implemented lexi-
cal subs, I thought I caught all these, must I missed this one.

8 years agotoke.c: Add comment for greppability
Father Chrysostomos [Mon, 6 Oct 2014 00:15:43 +0000 (17:15 -0700)]
toke.c: Add comment for greppability

8 years agoReorder t/lib/croak/toke
Father Chrysostomos [Mon, 6 Oct 2014 00:10:59 +0000 (17:10 -0700)]
Reorder t/lib/croak/toke

to put string terminator errors all in one place.

8 years agoMake B::Deparse qualify sub calls named after keywords
Father Chrysostomos [Sun, 5 Oct 2014 20:32:20 +0000 (13:32 -0700)]
Make B::Deparse qualify sub calls named after keywords

While B::Deparse was correctly applying CORE:: as necessary to dis-
ambiguate between keywords and custom subroutines, it was not doing
likewise for subroutines whose names were keywords.  main::foo()
should be deparsed as main::foo() if ‘foo’ is a keyword.

8 years ago[perl #122771] Fix assertion failure with -d and sort
Father Chrysostomos [Sun, 5 Oct 2014 20:30:36 +0000 (13:30 -0700)]
[perl #122771] Fix assertion failure with -d and sort

-d was conflicting with sort optimisations added by 932bca295d, which
had assertions that checked for nextstate, but not dbstate ops.

8 years agoRemove __SUB__ from Deparse-core.t exception list
Father Chrysostomos [Sun, 5 Oct 2014 20:11:01 +0000 (13:11 -0700)]
Remove __SUB__ from Deparse-core.t exception list

This list is for keywords exempt from the checks that make sure all
keywords have been tested.  __SUB__ *is* tested, so it does not
belong here.

8 years agoSimplify OP_LEAVESUBLV logic in op.c:op_lvalue
Father Chrysostomos [Sun, 5 Oct 2014 18:01:57 +0000 (11:01 -0700)]
Simplify OP_LEAVESUBLV logic in op.c:op_lvalue

If the lvalue type was OP_LEAVESUBLV, then the code for handling
entersub ops would go through extra checking to see whether we
have an lvalue sub available at compile time, before falling
through to the croaking code.  But the croaking code does not croak
if the type is OP_LEAVESUBLV, so the extra checks were for nothing.
We can skip those checks here just as we do for OP_GREPSTART,
OP_ENTERSUB and OP_REFGEN lvalue types.

8 years agoop.c:op_lvalue: Remove redundent case OP_RETURN
Father Chrysostomos [Sun, 5 Oct 2014 17:57:31 +0000 (10:57 -0700)]
op.c:op_lvalue: Remove redundent case OP_RETURN

The default case does nothing if the type is OP_LEAVESUBLV.  This has
been so since 145b2bbb3.

8 years agoDeparse inverted for(;;) cond more correctly
Father Chrysostomos [Sun, 5 Oct 2014 13:58:50 +0000 (06:58 -0700)]
Deparse inverted for(;;) cond more correctly

22584011 did not take the looks-like-a-function rule into account.

not ($1 || 2) ** 2 means (not ($1 || 2)) ** 2.

8 years agoDeparse.t: Another to-do test for lex subs
Father Chrysostomos [Sun, 5 Oct 2014 13:34:09 +0000 (06:34 -0700)]
Deparse.t: Another to-do test for lex subs

8 years agoConsistent spaces after dots in perlfunc
Father Chrysostomos [Sat, 4 Oct 2014 12:56:11 +0000 (05:56 -0700)]
Consistent spaces after dots in perlfunc

8 years agoclarify use VERSION docs
Doug Bell [Fri, 3 Oct 2014 03:52:24 +0000 (22:52 -0500)]
clarify use VERSION docs

Anything that C<use VERSION> adds, another C<use VERSION> may take away.
Explicitly doing the C<use strict> and/or C<use feature> means that
C<use VERSION> will not change them. C<use VERSION> will only change
the defaults, or things done by C<use VERSION>.

8 years agosilence compiler warnings in utf8_mg_pos_cache_update
Daniel Dragan [Sat, 4 Oct 2014 05:39:36 +0000 (01:39 -0400)]
silence compiler warnings in utf8_mg_pos_cache_update

commit 73ecc8cb69 added warnings on VC2003, silence them
..\sv.c(7556) : warning C4244: '=' : conversion from 'STRLEN' to 'float', possible loss of data
..\sv.c(7557) : warning C4244: '=' : conversion from 'const STRLEN' to 'float', possible loss of data
..\sv.c(7560) : warning C4244: '=' : conversion from 'const STRLEN' to 'float', possible loss of data
..\sv.c(7561) : warning C4244: '=' : conversion from 'STRLEN' to 'float', possible loss of data

8 years agooptimize SV creation funcs in sv.c
Daniel Dragan [Sat, 4 Oct 2014 06:14:02 +0000 (02:14 -0400)]
optimize SV creation funcs in sv.c

In Perl_newSV, the sv_upgrade is redundant, except to protect against a
segv in blindly SV body derefing SvGROW (but not in sv_grow). sv_grow has
always upgraded a non-PV SV to PV. So don't it here. Since a new SV will
never have be a COW, have a SvLEN or a body, all of which SvGROW uses,
just call sv_grow. Less branching, and smaller code that way.

In Perl_newSV_type, give a hint to compiler that if a platform's
symbol visibility allows inlining, and newSV_type's arg is the base type
(currently SVt_NULL, maybe SVt_IV in future (see ML)), to possibly inline
new_SV into the caller and remove the sv_upgrade call. Also don't call
sv_upgrade if it isn't needed (SVt_NULL) in the public symbol version.

The redundant sv_upgrade then sv_grow goes to commit 79072805bf
"perl 5.0 alpha 2". VC 2003 -01 32 bit threaded machine code size in bytes
of 2 functions
Perl_newSV_type before 0x2f after 0x29
Perl_newSV  before 0x48 after 0x28

8 years agoregcomp.c: Compiler warning
Father Chrysostomos [Sat, 4 Oct 2014 12:32:50 +0000 (05:32 -0700)]
regcomp.c: Compiler warning

Shut up this warning:

regcomp.c:7346:13: warning: format specifies type 'unsigned long' but the
      argument has type 'U32' (aka 'unsigned int') [-Wformat]
            RExC_study_chunk_recursed_count);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

by casting to auld lang syne—I mean unsigned long.

8 years agoFix assertion failure/hang with / (?{(^{})/
Father Chrysostomos [Sat, 4 Oct 2014 05:40:36 +0000 (22:40 -0700)]
Fix assertion failure/hang with / (?{(^{})/

When this invalid construct is parsed, the resulting op tree for the
pattern has a code block with no constant item following it, breaking
the assumptions made by pmruntime.

Fixing this was not so easy.

You can’t just adjust the assertions, because the hang that non-debug-
ging builds exhibited is still there.

You can’t just return NULL from pmruntime when encounting the bad op
tree, because the parser will crash on the null pointer.

You can’t just return the empty pmop, because the wrong pad is
active, and other functions in op.c will try to access nonexistent
pad entries.

You can’t just LEAVE_SCOPE and return the pmop, because then PL_parser
will be null in yyerror.  Changing yyerror to account is not suffi-
cient, because then you get double-freed SVs.  At that point I gave up
with that approach.

The easiest solution turned out to be to fake up the op that we were
expecting to see.

8 years agoXSLoader.t fix-up following 8e6aa27cd01.
Craig A. Berry [Sat, 4 Oct 2014 03:25:24 +0000 (22:25 -0500)]
XSLoader.t fix-up following 8e6aa27cd01.

The skip count was incorrect as there is only one test, not two.

Also, XSLoader uses forward slashes explicitly, so prepending a
path to what it concocts from the package name must be done in
Unix format regardless of platform.

8 years agoAdd linked mods to known_pod_issues
Father Chrysostomos [Fri, 3 Oct 2014 21:40:57 +0000 (14:40 -0700)]
Add linked mods to known_pod_issues

8 years agoperl5220delta: Mention mods from #122814
Father Chrysostomos [Fri, 3 Oct 2014 21:40:00 +0000 (14:40 -0700)]
perl5220delta: Mention mods from #122814

8 years agoDeparse inverted for(;;) condition correctly
Father Chrysostomos [Fri, 3 Oct 2014 21:19:59 +0000 (14:19 -0700)]
Deparse inverted for(;;) condition correctly

This is wrong:

$ perl -MO=Deparse -e 'for($a;!$b;$c){}'
for ($a; $b; $c) {
    ();
}

-e syntax OK

What happened to the bang?

This was broken in 5.12 by edbe35ea95.

8 years agoMake OP_METHOD* to be of new class METHOP
syber [Thu, 4 Sep 2014 18:08:59 +0000 (22:08 +0400)]
Make OP_METHOD* to be of new class METHOP

Introduce a new opcode class, METHOP, which will hold class/method related
info needed at runtime to improve performance of class/object method
calls, then change OP_METHOD and OP_METHOD_NAMED from being UNOP/SVOP to
being METHOP.

Note that because OP_METHOD is a UNOP with an op_first, while
OP_METHOD_NAMED is an SVOP, the first field of the METHOP structure
is a union holding either op_first or op_sv. This was seen as less messy
than having to introduce two new op classes.

The new op class's character is '.'

Nothing has changed in functionality and/or performance by this commit.
It just introduces new structure which will be extended with extra
fields and used in later commits.

Added METHOP constructors:
- newMETHOP() for method ops with dynamic method names.
  The only optype for this op is OP_METHOD.
- newMETHOP_named() for method ops with constant method names.
  Optypes for this op are: OP_METHOD_NAMED (currently) and (later)
  OP_METHOD_SUPER, OP_METHOD_REDIR, OP_METHOD_NEXT, OP_METHOD_NEXTCAN,
  OP_METHOD_MAYBENEXT

(This commit includes fixups by davem)

8 years agoDo not rely on the precise error wording
Rafael Garcia-Suarez [Fri, 3 Oct 2014 12:03:13 +0000 (14:03 +0200)]
Do not rely on the precise error wording

'No such file or directory' is fine on Linux but other UNIXes might
say it differently, for example 'A file or directory in the path name does not exist'.

8 years agoperldelta for 8e6aa27cd01d, 30837b2a7d75, de937bde1656
Tony Cook [Fri, 3 Oct 2014 05:40:18 +0000 (15:40 +1000)]
perldelta for 8e6aa27cd01d30837b2a7d75de937bde1656

8 years ago[perl #122455] fix XSLoader loading other namespaces
Tony Cook [Fri, 3 Oct 2014 05:30:35 +0000 (15:30 +1000)]
[perl #122455] fix XSLoader loading other namespaces

8 years agobump $XSLoader::VERSION
Tony Cook [Fri, 3 Oct 2014 05:20:45 +0000 (15:20 +1000)]
bump $XSLoader::VERSION

8 years agoAllow XSLoader to load modules from a different namespace
Graham Knop [Fri, 1 Aug 2014 12:30:42 +0000 (08:30 -0400)]
Allow XSLoader to load modules from a different namespace

When trying to locate the binary component of a module, use the caller
package to find the library root directory, not the passed in module
name.  Since the file path it is using is always taken from the caller,
using the passed in package prevents it from finding the library root.
If in the package File::Spec::Unix, and given XSLoader::load("Cwd"), the
library root is three levels up from the filename of the
File::Spec::Unix module, not one.

8 years ago[perl #122455] TODO test for XSLoader mishandling of namespaces
Tony Cook [Thu, 7 Aug 2014 01:06:45 +0000 (11:06 +1000)]
[perl #122455] TODO test for XSLoader mishandling of namespaces

8 years ago[perl #122657] TODO checking the result of recv() on hurd
Tony Cook [Wed, 1 Oct 2014 01:33:19 +0000 (11:33 +1000)]
[perl #122657] TODO checking the result of recv() on hurd

8 years agoCompare recv return value to peername in socket test
Leon Timmermans [Wed, 24 Sep 2014 21:17:21 +0000 (23:17 +0200)]
Compare recv return value to peername in socket test

8 years agoDeparse ‘local our’
Father Chrysostomos [Thu, 2 Oct 2014 21:13:20 +0000 (14:13 -0700)]
Deparse ‘local our’

Deparse was omitting the ‘our’.

8 years agoKeep concise-xs.t happy
Father Chrysostomos [Thu, 2 Oct 2014 21:13:15 +0000 (14:13 -0700)]
Keep concise-xs.t happy

8 years agoDeparse \(..., (@a), ...) correctly
Father Chrysostomos [Thu, 2 Oct 2014 20:38:12 +0000 (13:38 -0700)]
Deparse \(..., (@a), ...) correctly

It is the presence of parentheses immediately around the array (and
possibly local/our/my/+) in refgen context, rather than parentheses
surrounding the argument to \, that causes the array to be flattened.

B::Deparse was deparsing \(@a) correctly, but not \(@a, (@b)), in
which takes a reference to @a and to each of @b’s elements.  It was
omitting the parentheses around @b.

8 years agoUpdate comments for OPf_SPECIAL/do
Father Chrysostomos [Thu, 2 Oct 2014 19:54:15 +0000 (12:54 -0700)]
Update comments for OPf_SPECIAL/do

‘do subname’ has been removed, so OPf_SPECIAL no longer applies to
OP_ENTERSUB.

8 years agoMake list assignment respect foreach aliasing
Father Chrysostomos [Thu, 2 Oct 2014 19:44:19 +0000 (12:44 -0700)]
Make list assignment respect foreach aliasing

See ff2a62e0c8 for the explanation.  The bug fix in that commit did
not apply to foreach’s aliasing.

In short, ($a,$b)=($c,$d) needs to account for whether two of those
variable names could be referring to the same variable.

This commit causes the test suite to exercise a code path in scope.c
added by ff2a62e0c8, which turned out to be buggy.  (I forgot to test
it at the time.)

8 years agoThe Module-CoreList on CPAN is now 5.20141002
Chris 'BinGOs' Williams [Thu, 2 Oct 2014 11:10:59 +0000 (12:10 +0100)]
The Module-CoreList on CPAN is now 5.20141002

8 years agoThere's no need to rewrite the Module-CoreList pod now
Chris 'BinGOs' Williams [Thu, 2 Oct 2014 08:11:14 +0000 (09:11 +0100)]
There's no need to rewrite the Module-CoreList pod now

8 years agoMake the CAVEAT entry in Module-CoreList pod sane
Chris 'BinGOs' Williams [Thu, 2 Oct 2014 08:08:48 +0000 (09:08 +0100)]
Make the CAVEAT entry in Module-CoreList pod sane

8 years agoUpdate Module-CoreList Changes file for 5.20141002 release
Chris 'BinGOs' Williams [Thu, 2 Oct 2014 08:01:06 +0000 (09:01 +0100)]
Update Module-CoreList Changes file for 5.20141002 release

8 years agocorelist: import v5.18.3 and v5.18.4 data
Ricardo Signes [Thu, 2 Oct 2014 01:28:44 +0000 (21:28 -0400)]
corelist: import v5.18.3 and v5.18.4 data

8 years agoperlhist: bring in 5.18.3 and 5.18.4 release dates
Ricardo Signes [Thu, 2 Oct 2014 01:26:20 +0000 (21:26 -0400)]
perlhist: bring in 5.18.3 and 5.18.4 release dates

8 years agoimport latest epigraphs from maint-5.18
Ricardo Signes [Thu, 2 Oct 2014 01:19:16 +0000 (21:19 -0400)]
import latest epigraphs from maint-5.18

8 years agoMaintainers.pl: Include all Deparse-*.t files in _PERLLIB
Father Chrysostomos [Wed, 1 Oct 2014 23:21:47 +0000 (16:21 -0700)]
Maintainers.pl: Include all Deparse-*.t files in _PERLLIB

8 years agoSort MANIFEST properly
Father Chrysostomos [Wed, 1 Oct 2014 23:19:42 +0000 (16:19 -0700)]
Sort MANIFEST properly

8 years agoCorrect and update sv.c’s string copy comments
Father Chrysostomos [Wed, 1 Oct 2014 23:17:52 +0000 (16:17 -0700)]
Correct and update sv.c’s string copy comments

Thanks to Dave Mitchell for pointing out my mistakes.

Whether the rhs is copy-on-write already does not change whether we
do the long-string-and-left-buffer-size check.  The comments (added in
2ac0bcb35) were wrong.

Also, update the comments for e8c6a474e, which added the
big-buffer-on-the-right skip logic.

8 years ago[perl #122870] Fix B::Deparse–DDS compatibility
Father Chrysostomos [Wed, 1 Oct 2014 23:07:46 +0000 (16:07 -0700)]
[perl #122870] Fix B::Deparse–DDS compatibility

8 years agoAdd tests for overriding <> versus rcatline
Rafael Garcia-Suarez [Wed, 1 Oct 2014 07:13:05 +0000 (09:13 +0200)]
Add tests for overriding <> versus rcatline

8 years agoNew <<>> tests
Rafael Garcia-Suarez [Wed, 1 Oct 2014 07:03:10 +0000 (09:03 +0200)]
New <<>> tests

- Modify test to test also that <<>> with empty (false) lines
- Add a test for <<>> used in a rcatline op

8 years agoUpstream a patch from pkgsrc for NetBSD hints
Chris 'BinGOs' Williams [Tue, 30 Sep 2014 18:15:05 +0000 (19:15 +0100)]
Upstream a patch from pkgsrc for NetBSD hints