This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Father Chrysostomos [Mon, 10 Nov 2014 07:53:42 +0000 (23:53 -0800)]
Don’t allow OPpTARGET_MY with integer negation
$ ./perl -Ilib -le 'use integer; my $a = "fake"; $a = -$a; print "[$a]"'
[--]
As of
1c2b3fd6f1, negation under ‘use integer’ can do string negation,
which modifies the return value before reading the argument. So, like
regular non-integer negation, it must forego this optimisation.
Father Chrysostomos [Mon, 10 Nov 2014 07:49:09 +0000 (23:49 -0800)]
op_private: Update concat TARGLEX comment
This changed in
69b47968fa.
Father Chrysostomos [Mon, 10 Nov 2014 07:40:16 +0000 (23:40 -0800)]
lex_assign.t: Add comment explaining this file
Father Chrysostomos [Mon, 10 Nov 2014 07:37:00 +0000 (23:37 -0800)]
lex_assign.t: Don’t skip all failing tests
This was emasculated by
5cd1152e1.
Also, yank some crazy skip code that goes like this:
if ($condition) {
SKIP: {
skip "reason", 1; # unconditionally
pass(); # unreached
}
}
Father Chrysostomos [Mon, 10 Nov 2014 03:57:55 +0000 (19:57 -0800)]
pp.c:do_chomp: Remove redundant assignment
The value of s is not used after this.
Daniel Dragan [Mon, 10 Nov 2014 03:57:08 +0000 (22:57 -0500)]
dont run extension building make twice on a fresh src tree
On a fresh source tree, "[*]make config" then "[*]make all" are executed.
The "make config" is redundant in this case, and launching make process
twice, plus make's I/O calls is inefficient. On a dirty source tree, this
would break since the makefile will regenerate. If "make all" fails the
first time (presumably because because the makefile was regened, other
failures just run/print twice), run the "make all" more time. Dirty trees
still run make twice, clean trees drop from running make twice to just
once.
Chris 'BinGOs' Williams [Sat, 8 Nov 2014 14:11:24 +0000 (14:11 +0000)]
Update ExtUtils-MakeMaker to CPAN version 7.02
[DELTA]
7.02 Sat Nov 8 07:13:40 GMT 2014
No changes from 7.01_09
7.01_09 Thu Nov 6 21:41:32 GMT 2014
Test fixes:
- Marked a test in pm_to_blib.t as TODO until further
investigation can be scheduled
7.01_08 Tue Nov 4 20:24:29 GMT 2014
Test fixes:
- roll back change in 7.01_07 and scrub PERL_INSTALL_QUIET
environment variable
7.01_07 Tue Nov 4 19:26:46 GMT 2014
Test fixes:
- Changed a regex in pm_to_blib.t to be more forgiving
7.01_06 Mon Nov 3 20:31:05 GMT 2014
Bug fixes:
- Resolved regression with TEST_FILES
Win32 fixes:
- Targetted fix for nmake bug
- miniperl.t core test fixed for Windows
7.01_05 Mon Nov 3 10:14:11 GMT 2014
VMS fixes:
- Handle switches in $(PERL) by prepending MCR
- Don't quote MAKE on VMS in Test::Utils
7.01_04 Fri Oct 31 09:38:06 GMT 2014
API change:
- writeMakefile() has been removed after 20 years of being deprecated
Bug fixes:
- Regression in xs.t with older versions of xsubpp has been resolved
- We now don't produce Borland C export symbols if BCC support dropped
7.01_03 Thu Oct 30 19:12:57 GMT 2014
Bug fixes:
- Using NMAKE was broken this has been fixed
7.01_02 Sat Oct 25 17:45:46 BST 2014
Bug fixes:
- Resolve a regression with FIXIN and core builds on Win32
7.01_01 Sat Oct 25 13:45:00 BST 2014
Bug fixes:
- Resolve issue with Win32 perl builds in core
7.00 Wed Oct 22 20:13:38 BST 2014
No changes from 6.99_18
6.99_18 Mon Oct 20 10:02:58 BST 2014
Bug fixes:
- Resolve regression with taint and get_version() [RT#99580]
VMS fixes:
- Avoid .NOTPARALLEL on VMS as it is a syntax error for MMS and MMK
- Quotes are not stripped from argv[0] on VMS so need stripping
- Move MCR from PERL to PERLRUN on VMS and other *RUN variables
6.99_17 Sun Oct 12 19:37:04 BST 2014
Bug fixes:
- Fix test that got broke under core since 6.99_15
6.99_16 Thu Oct 2 19:29:49 BST 2014
Dist fixes:
- Move File::Copy::Recursive from bundled to where it is
used, so that it will not get installed as a runtime
prereq
6.99_15 Sun Sep 21 13:21:46 BST 2014
Enhancements:
- If core, add ccwarnflags and ccstdflags, if available
Doc fixes:
- Fix internal links
6.99_14 Fri Sep 19 14:59:08 BST 2014
Bug fixes:
- Fixes to fallback version module for core integration problems
6.99_13 Mon Sep 15 20:02:47 BST 2014
Enhancements:
- Bundle Encode::Locale as ExtUtils::MakeMaker::Locale
Bug fixes:
- Make included version module have standardised dist versioning
6.99_12 Thu Sep 11 15:27:31 BST 2014
Enhancements:
- Now include a fallback version module for bootstrapping
Bug fixes:
- Support libfoo.0.dylib style libraries on Darwin
6.99_11 Mon Sep 8 14:20:26 BST 2014
Bug fixes:
- Handle chcp failure better on MSWin32
- Tests should be parallelisable once again
Doc fixes:
- Document that GNU make is usable on MSWin32 now
6.99_10 Thu Sep 4 14:28:01 BST 2014
Bug fixes:
- Fixes for being integrated with core
- Fixed the code page reset on MSWin32
- Fixed test failures on BSD with UTF8 filenames
- Fixed regression with quoting of $(PERL) when
command line flags are used
6.99_09 Thu Aug 28 11:01:37 BST 2014
Enhancements:
- Support GNU Make on Windows
- Support paths and filenames that are UTF8 encoded
- MM->can_run() added for finding programs (ported from
IPC::Cmd)
Bug fixes:
- Handle UTF8 when generating manpages correctly
- Generated Makefile contents are now consistently sorted
6.99_08 Mon Aug 18 14:17:04 BST 2014
Bug fixes:
- Liblist::Kid: can now handle -l:foo.so invocations properly
- Scripts will no longer have the 'not running under some shell' code
applied when rewriting shebang lines.
- version is now used to parse prereqs versions internally
- Support UTF8 encoded command-line args and Makefile.PL args
- Generated META.files will now always have linefeed EOLs, even on
Windows
- Rewrite the version line eval handling to have less insane edge cases
Doc fixes:
- Documentation now includes links to Dist::Zilla, File::ShareDir and
File::ShareDir::Install
- Clarified support policy for < v5.8.1 in README
Misc:
- Updated bundled CPAN::Meta::Requirements to version 2.126
- Updated bundled ExtUtils::Manifest to version 1.65
6.99_07 Wed Jul 30 17:36:14 BST 2014
Bug fixes:
- Resolve 'wide character in print' warnings
6.99_06 Mon Jul 28 15:02:25 BST 2014
Enhancements:
- Improvements and tests for the spaces-in-stuff handling
6.99_05 Tue Jul 22 12:32:03 BST 2014
Enhancements:
- Enable working with (including installing to) directories with spaces in names
6.99_04 Sat Jul 12 12:43:08 BST 2014
Enhancements:
- No longer report each file being manified. Only summarise.
6.99_03 Fri Jul 4 11:02:21 BST 2014
Doc Fixes:
- PATCHING document has been rewritten as CONTRIBUTING and TODO
document has been removed
Bug Fixes:
- Rearranged bundled prereqs so CPAN::Meta::Requirements won't
get stomped on if it is installed already, but CPAN::Meta isn't
6.99_02 Thu Jun 5 12:15:28 BST 2014
Bug fixes:
* MM->parse_version will no longer warn if it could
not determine the $VERSION due to syntax errors etc.
6.99_01 Tue Jun 3 22:17:30 BST 2014
Bug fixes:
* Disregard some warnings during tests when cross-compiling
Doc fixes:
* Clarified the use and limitations of META_ADD, META_MERGE
Test fixes:
* Sanitise env vars in tests
Tony Cook [Mon, 10 Nov 2014 05:01:02 +0000 (16:01 +1100)]
NetBSD 5.1 doesn't support some of the new symbols POSIX wants
Father Chrysostomos [Mon, 10 Nov 2014 02:28:34 +0000 (18:28 -0800)]
More TARGLEX comments in op_private
Father Chrysostomos [Mon, 10 Nov 2014 02:25:44 +0000 (18:25 -0800)]
pp.c:do_chomp: Remove redundant sv_force_normal
We do SvPV_force later on, which also handles COWs. If there was
nothing to chomp, we were flattening the COW needlessly.
We need to do an IsCOW check later, though, for chop (not chomp).
Father Chrysostomos [Mon, 10 Nov 2014 01:36:44 +0000 (17:36 -0800)]
Fix $lex = chomp $lex regression from 5.12
Commit
2f9970be0 (5.13.9) caused the lhs to be written to with 0
before the chomp happens, and then incremented for each chomp on the
rhs argument.
That makes
my $a = $/ = 7;
$a = chomp $a;
print $a;
print 0 instead of 1 and makes
my $a = $/ = 0;
$a = chomp $a;
assign the empty string to $a instead of 1.
Tony Cook [Tue, 4 Nov 2014 06:26:21 +0000 (17:26 +1100)]
[perl #121337] fix issues with op/utf8cache.t
This test had two problems:
- it used Devel::Peek::Dump() without loading it, broken when the script
was refactored to use test.pl in
c45bec600
- the C< open CHILD "-|" > doesn't work on Win32
Since the test didn't check it was receiving reasonable dump output,
neither problem resulted in a test failure.
Jarkko Hietaniemi [Sun, 9 Nov 2014 23:26:06 +0000 (18:26 -0500)]
PoisonPADLIST should not be totally empty.
(It is e.g. used as "... else PoisonPADLIST();" in sv.c)
Jarkko Hietaniemi [Sun, 9 Nov 2014 23:03:43 +0000 (18:03 -0500)]
Txoic tpyo.
Jarkko Hietaniemi [Sun, 9 Nov 2014 21:42:18 +0000 (16:42 -0500)]
FreeBSD may not have the C99 long double math interfaces.
(This sanity logic could migrated to Configure)
Father Chrysostomos [Sun, 9 Nov 2014 20:50:54 +0000 (12:50 -0800)]
Don’t allow OPpTARGET_MY on postdec/inc
I was wrong in
9e319cc4f. postfix ++/-- writes to its return value
before reading its argument. If we optimise away the scalar
assignment in
$a = $b++;
(that’s what OPpTARGET_MY does), then $a gets written to before $b is
read. If $a and $b are the same, we get the wrong answer. This bug
has been present under ‘use integer’ since 5.6.0. I accidentally
extended it to non-integer ++/-- in
9e319cc4f.
(It’s not likely that someone will write $a = $b++, but it could hap-
pen inadvertently in more complex code.)
Father Chrysostomos [Sun, 9 Nov 2014 19:48:49 +0000 (11:48 -0800)]
tr_utf8.t: Suppress warning
Father Chrysostomos [Sun, 9 Nov 2014 19:42:58 +0000 (11:42 -0800)]
sv.c:find_uninit_var: use newSVpvs_flags
This makes the machine code smaller.
Father Chrysostomos [Sun, 9 Nov 2014 19:41:43 +0000 (11:41 -0800)]
op.c:bind_match: remove redundant var
This shrinks the machine code slightly.
Father Chrysostomos [Sun, 9 Nov 2014 19:36:19 +0000 (11:36 -0800)]
Skip padsv op in $lex =~ ...
m//, s/// and y/// already have logic to deal with implicit lexical
$_. The pad offset of $_ is stored in the match op itself. We can
take advantage of that and extend it to lexical variables in general.
That way we have fewer ops to execute, as $lex =~ // no longer calls
pp_padsv. It also allows lexical variables’ names to be mentioned in
uninitialized warnings for y///.
Father Chrysostomos [Sun, 9 Nov 2014 18:54:39 +0000 (10:54 -0800)]
Don’t check OPpTARGET_MY on match ops at run time
The offset in op_targ is sufficient. The next commit will take advan-
tage of this.
David Mitchell [Sun, 9 Nov 2014 15:43:10 +0000 (15:43 +0000)]
util.c: fix comiler warnings
A recent commit gave some warnings about format types,
and assignments without extra parens within an if condition.
Craig A. Berry [Sun, 9 Nov 2014 03:22:55 +0000 (21:22 -0600)]
Version bump for File::Spec::VMS.
Craig A. Berry [Sun, 9 Nov 2014 03:16:12 +0000 (21:16 -0600)]
Simplify abs2rel.t.
Factor out all the things that were common for the different test
cases (which was everything except the filename). And use made-up
names that indicate what's being tested rather than special system
filenames commonly found on Unix systems. Otherwise, if, for
example, a test for "'init.d' is a directory" fails, you'd be
wondering whether something is wrong with your system rather than
looking for problems in File::Spec, which is what we're testing.
Craig A. Berry [Sun, 9 Nov 2014 03:08:16 +0000 (21:08 -0600)]
Fix undefined warning in File::Spec::VMS::catfile.
We had very carefully created a lexical variable to hold a default
result when the filename was undefined. Then we forgot to use it.
Now we use it.
Craig A. Berry [Sun, 9 Nov 2014 00:43:15 +0000 (18:43 -0600)]
Force barename base to be a directory in File::Spec::VMS:abs2rel.
The docs say that the filename portion of base is ignored, but they
don't specify what happens when base is a single component without
directory syntax, leaving ambiguous whether it's a file or a Unix-
style directory spec. Let's default to the latter for greatest
consistency with what happens elsewhere.
Craig A. Berry [Sun, 9 Nov 2014 00:27:44 +0000 (18:27 -0600)]
Revise Unix syntax detection File::Spec::VMS::abs2rel.
For a long time we've punted to the Unix method if either path or
base has a forward slash in it. But that really only works if
*both* are not native specs. So check for that by making sure we
don't have unescaped left bracket (square or angle) or colon in
either parameter before handing off to File::Spec::Unix::abs2rel.
Craig A. Berry [Sun, 9 Nov 2014 00:13:38 +0000 (18:13 -0600)]
Move rel2abs earlier in File::Spec::VMS::abs2rel.
We need to make the path and base parameters absolute before
splitting them apart and comparing their pieces. Since rel2abs
will do its own canonpath, we don't need to do that anymore here.
Father Chrysostomos [Sun, 9 Nov 2014 06:48:12 +0000 (22:48 -0800)]
Extend y/// warnings to utf8
Father Chrysostomos [Sun, 9 Nov 2014 06:06:55 +0000 (22:06 -0800)]
release_schedule.pod: Correct some versions
Ricardo Signes [Sun, 9 Nov 2014 04:18:39 +0000 (23:18 -0500)]
release schedule: 5.18.4 shipped, 5.18.5 may happen
Ricardo Signes [Sun, 9 Nov 2014 04:18:19 +0000 (23:18 -0500)]
release schedule: the v5.22 landing plan
Father Chrysostomos [Sun, 9 Nov 2014 02:45:04 +0000 (18:45 -0800)]
op.c:scalarvoid: Remove redundant scalar(o)
Father Chrysostomos [Sun, 9 Nov 2014 02:35:59 +0000 (18:35 -0800)]
op.c:ck_sassign: Simplify freeing of sassign op
Instead of detaching both the rhs and lhs and then freeing the assign-
ment and the lhs, just detach the rhs and free the assignment. This
results in smaller machine code.
Father Chrysostomos [Sun, 9 Nov 2014 02:33:19 +0000 (18:33 -0800)]
Don’t use OP_SIBLING(o) in op.c:ck_sassign
When this is called, the op is not part of a larger tree yet, so its
sibling is always NULL.
Father Chrysostomos [Sun, 9 Nov 2014 00:49:45 +0000 (16:49 -0800)]
Shrink PL_op_private_bitdefs
It doesn’t matter whether things in this table are ordered by opcode,
because the indices into it are stored in PL_op_private_bitdef_ix.
If we have multiple ops with exactly the same private flags, we don’t
need multiple entries in PL_op_private_bitdefs.
One practical advantage is that patches are less likely to conflict,
which will make rebasing easier. (I hope.)
Father Chrysostomos [Sun, 9 Nov 2014 00:07:19 +0000 (16:07 -0800)]
[Merge] More OA_DANGEROUS stuff
The OA_DANGEROUS op type flag indicates that an op might return a
value referenced elsewhere, so list assignment should make tempor-
ary copies.
Some ops had this flag needlessly. Some lacked it erroneously,
resulting in bugs.
Father Chrysostomos [Sat, 8 Nov 2014 22:44:46 +0000 (14:44 -0800)]
values and each are OA_DANGEROUS
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
values and each can both return scalars that are referenced elsewhere,
causing list assignment to behave erratically if temporary copies
are not made.
Father Chrysostomos [Sat, 8 Nov 2014 22:32:58 +0000 (14:32 -0800)]
smartkve.t doesn’t need to disable dep warnings
Father Chrysostomos [Sat, 8 Nov 2014 21:06:14 +0000 (13:06 -0800)]
kill is not OA_DANGEROUS
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
kill only ever returns a target unused elsewhere, so it does not
necessitate temp copies in list assignment.
Father Chrysostomos [Sat, 8 Nov 2014 21:05:28 +0000 (13:05 -0800)]
exec is not OA_DANGEROUS
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
When exec fails, it only ever returns a target unused elsewhere, so it
does not necessitate temp copies in list assignment.
Father Chrysostomos [Sat, 8 Nov 2014 21:03:45 +0000 (13:03 -0800)]
enterwrite is not OA_DANGEROUS
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
‘write’ only ever returns a read-only true or false, so temp copies
are not necessary for its sake.
Father Chrysostomos [Sat, 8 Nov 2014 21:00:33 +0000 (13:00 -0800)]
Fix ext/B/t tests after OA_DANGEROUS removals
Father Chrysostomos [Sat, 8 Nov 2014 20:54:37 +0000 (12:54 -0800)]
tied is OA_DANGEROUS
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
tied returns the same scalar that the tied variables uses to hold a
reference to the object (so weaken(tied(...)) works). tie uses the
very scalar that TIESCALAR (or TIEWHATEVER) returns and attaches it to
the tied variable by magic. That returned scalar could be referenced
elsewhere. That means
($a, $b) = ($c, tied $d)
could have common vars on either side, if the tie constructor for $d
happened to return $a or $b. (Normally it would have to be an XSUB or
an lvalue sub for its return value not to have been copied.)
Father Chrysostomos [Sat, 8 Nov 2014 20:45:13 +0000 (12:45 -0800)]
Remove OA_DANGEROUS from exit
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
exit usually doesn’t return. When it fails, it returns a read-only
undef, so we don’t need temp copies for its sake.
Father Chrysostomos [Sat, 8 Nov 2014 20:40:18 +0000 (12:40 -0800)]
Remove OA_DANGEROUS from loopctl-type ops
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
These operators never return, so they shouldn’t necessitate
temp copies.
(This could probably apply to dump, too, but I don’t fully under-
stand dump.)
Father Chrysostomos [Sat, 8 Nov 2014 20:38:32 +0000 (12:38 -0800)]
Remove OA_DANGEROUS from die
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
die never returns, so it shouldn’t necessitate temp copies.
Father Chrysostomos [Sat, 8 Nov 2014 20:37:43 +0000 (12:37 -0800)]
Remove OA_DANGEROUS from cond_expr
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
?: always returns one of its arguments. Since aassign_common_vars,
which does the danger check, also checks the kids of the cond_expr op,
it is not necessary for cond_expr to be flagged this way.
Father Chrysostomos [Sat, 8 Nov 2014 20:36:02 +0000 (12:36 -0800)]
Remove OA_DANGEROUS from grep and map
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
grep returns its arguments, while map returns the results of its first
expression. Since aassign_common_vars, which does the danger check,
will also check the kids of the mapstart/grepstart ops, it is not nec-
essary for grep and map themselves to be flagged this way.
Father Chrysostomos [Sat, 8 Nov 2014 20:30:33 +0000 (12:30 -0800)]
Remove OA_DANGEROUS from sort
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
pp_sort returns its arguments. aassign_common_vars will check its kid
ops for danger as well, so it’s not necessary for sort itself to be
flagged this way. This will allow cases like ($a,$b) = sort($c,$d) to
forego the temp copy.
Father Chrysostomos [Sat, 8 Nov 2014 14:21:31 +0000 (06:21 -0800)]
Don’t copy VMS hints to cop->op_private
Commit
d5ec29879 in 2006 started storing all the hints in COPs. Some
VMS-specific hints have nonetheless still been copied from PL_hints to
cop->op_private, though that is no longer necessary.
Jarkko Hietaniemi [Sat, 8 Nov 2014 20:43:22 +0000 (15:43 -0500)]
FV_ISFINITE, not FV_ISINITE.
Father Chrysostomos [Sat, 8 Nov 2014 18:41:23 +0000 (10:41 -0800)]
Remove OA_DANGEROUS from non-integer postdec/inc
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
While pp_postinc may return a lexical scalar, that only happens when
the OPpTARGET_MY optimisation is happening; and aassign_common_vars in
op.c checks specifically for that.
Otherwise, it only returns a mortal or target, so it is not
OA_DANGEROUS.
Father Chrysostomos [Sat, 8 Nov 2014 18:12:30 +0000 (10:12 -0800)]
Allow OPpTARGET_MY on non-integer postdec/inc
I don’t know why this was not done to begin with. The previous two
commits fixed the only outstanding problems I am aware of.
Father Chrysostomos [Sat, 8 Nov 2014 18:11:53 +0000 (10:11 -0800)]
Make pp_postinc call set-magic on its target
Its target may be a lexical scalar (under ‘use integer’ currently, and
soon even outside of ‘use integer’). The assignment in $lex = $foo++
currently gets optimised away and ++ writes directly to $lex.
Father Chrysostomos [Sat, 8 Nov 2014 18:05:15 +0000 (10:05 -0800)]
Fix $lex = $ref++ under use integer
Operators generally have targets, that is, scalars in the pad that are
used to return values. The same scalar is used again and again for
efficiency.
If the value assigned to a target is a reference, that can be bad,
because the referent will last longer than expected, even forever.
$ref++ used to have this problem (bug #9466).
So commit v5.13.4-148-g7dcb9b9 fixed it by returning a new mortal if
the return value was a reference.
However, under ‘use integer’, the OPpTARGET_MY optimisation is per-
mitted on postdec and postinc (why only under ‘use integer’ I don’t
know). Under that optimisation, $lexicalvariable = <some op> has the
assignment optimised away and the lexical variable becomes the operat-
or’s target.
If we skip assigning to the target and it is a lexical variable, then
the assignment never happens:
$ perl5.14.4 -le 'my $x=7; $_={}; $x = $_++; print $x'
HASH(0x7ff4a8806d00)
$ perl5.14.4 -Minteger -le 'my $x=7; $_={}; $x = $_++; print $x'
7
Jarkko Hietaniemi [Sat, 8 Nov 2014 17:23:20 +0000 (12:23 -0500)]
Using bignum needs skip_if_miniperl().
Jarkko Hietaniemi [Sat, 8 Nov 2014 17:12:42 +0000 (12:12 -0500)]
skip_all, not skip, if only miniperl.
Jarkko Hietaniemi [Sat, 8 Nov 2014 15:58:18 +0000 (10:58 -0500)]
Wrong (non-existent) Config var name.
Jarkko Hietaniemi [Sat, 8 Nov 2014 17:46:54 +0000 (12:46 -0500)]
Fix one test message, add two tests.
Jarkko Hietaniemi [Sat, 8 Nov 2014 14:20:23 +0000 (09:20 -0500)]
undef the temp variables between tests.
This way a failing result doesn't carry over between subtests.
Jarkko Hietaniemi [Sat, 8 Nov 2014 16:01:43 +0000 (11:01 -0500)]
Perl_isfinitel is not necessarily always there.
Jarkko Hietaniemi [Sat, 8 Nov 2014 16:05:51 +0000 (11:05 -0500)]
Drop uselongdouble unless it really gives longer doubles.
Father Chrysostomos [Sat, 8 Nov 2014 17:39:25 +0000 (09:39 -0800)]
Remove OA_DANGEROUS from subst(cont)
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
pp_subst and pp_substcont only push new mortal scalars or read-only
values on to the stack. Hence they are not OA_DANGEROUS.
Father Chrysostomos [Sat, 8 Nov 2014 15:07:15 +0000 (07:07 -0800)]
Remove OA_DANGEROUS from match
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
pp_match pushes new mortals on to the stack in list context (or a
read-only boolean; read-only values don’t matter), so they can’t
occur elsewhere. Hence it is not OA_DANGEROUS.
Father Chrysostomos [Sat, 8 Nov 2014 08:09:54 +0000 (00:09 -0800)]
Fix up f_map.t following "\L$_" optimisation
Father Chrysostomos [Sat, 8 Nov 2014 06:23:16 +0000 (22:23 -0800)]
Make B constants depend on perl headers
Making the Makefile depend on the headers where the constants are
found will force Makefile.PL to be re-run, and it is Makefile.PL that
generates the constants.
Father Chrysostomos [Sat, 8 Nov 2014 05:50:37 +0000 (21:50 -0800)]
Optimise stringify away for "\Q$_" "\u$_" etc.
Father Chrysostomos [Sat, 8 Nov 2014 05:46:58 +0000 (21:46 -0800)]
Allow OPpTARGET_MY optimisation for split
Many operators have a special SV allocated in the pad which is used
for return values (the target). If we make that pad offset point to
a lexical variable, then we can optimise, say, $lexical = "$foo" into
just "$foo", where $lexical is stringify’s ‘target’. And pp_stringify
doesn’t need to know any better. We already do that for many ops.
This is safe to extend to split. split only uses its target in this
code at the end:
GETTARGET;
PUSHi(iters);
so there is no danger of modifying its argument before reading it.
Father Chrysostomos [Sat, 8 Nov 2014 07:34:11 +0000 (23:34 -0800)]
Fix Deparse OPpLVAL_INTRO handling in lists
The renumbering of private flags a few commits ago caused an exist-
ing Deparse bug to occur more often. It was assuming that the
OPpLVAL_INTRO and OPpOUR_INTRO flags could occur on any ops for which
it did not have explicit exceptions.
This commit changes it to check for only those ops known to use those
flags, thus fixing bug #119815.
Father Chrysostomos [Sat, 8 Nov 2014 05:42:54 +0000 (21:42 -0800)]
Renumber op flags so TARGET_MY and OUR_INTRO differ
I need split to be able to take both flags. Renumbering OUR_INTRO
sets off a chain reaction requiring that various other flags be renum-
bered. These are the affected ops:
gvsv rv2sv rv2av rv2hv enteriter split rv2gv padsv aelem helem entersub padav padhv lvavref lvref refassign pushmark rv2cv
----------------------------------------------------------------------------------------------------------------------------------
0 inargs
1 strct strct strct strct strct strct
2 slicw silcw reversed noinit targ slicw slicw elem elem targ
3 lvsub lvsub def lvsub lvsub lvsub amper lvsub lvsub iter iter amper
4 our our our our our our fake state defer defer dbg state state state state state state dbg
5-6 dref bool dref dref dref dref dref bool type type const(6)
7 intro intro intro intro intro implim intro intro intro intro intro intro intro intro intro intro intro nopar
If we use 6 for OUR_INTRO and shift 5-6 down to 4-5, that frees up 4
(aka OPpTARGET_MY) for use on split.
op.c:scalarvoid was testing the OPpOUR_INTRO flag on ops that don’t
take it, so it needed adjustment.
Father Chrysostomos [Sat, 8 Nov 2014 04:33:51 +0000 (20:33 -0800)]
op_private: Remove incorrect OPpLVREF_TYPE comment
At the time, I was trying to rearrange the magic flags so that
OPpLVREF_TYPE could be copied into mg->mg_flags for lvref magic. Then
I saw that mg_private was available and gave up on the whole idea; but
this comment remained.
Daniel Dragan [Sat, 8 Nov 2014 05:48:58 +0000 (00:48 -0500)]
optimize Perl_boot_core_UNIVERSAL and Perl_nextargv
Perl_nextargv fuse 2 tests into 1
Perl_boot_core_UNIVERSAL reorder instructions to avoid using a non-vol
registers (save cv across the Safefree), not reread CV body * after
Safefree. Compute address of CvFILE once.
for Perl_boot_core_UNIVERSAL on VC 2003 before 0x66 bytes of 32 bit x86
machine code, after 0x61.
Daniel Dragan [Sat, 8 Nov 2014 05:20:52 +0000 (00:20 -0500)]
add xs_handshake API
This API elevates the amount of ABI compatibility protection between XS
modules and the interp. It also makes each boot XSUB smaller in machine
code by removing function calls and factoring out code into the new
Perl_xs_handshake and Perl_xs_epilog functions.
sv.c :
- revise padlist duping code to reduce code bloat/asserts on DEBUGGING
ext/DynaLoader/dlutils.c :
- disable version checking so interp startup is faster, ABI mismatches are
impossible because DynaLoader is never available as a shared library
ext/XS-APItest/XSUB-redefined-macros.xs :
- "" means dont check the version, so switch to " " to make the test in
xsub_h.t pass, see ML thread "XS_APIVERSION_BOOTCHECK and XS_VERSION
is CPP defined but "", mow what?"
ext/re/re.xs :
- disable API version checking until #123007 is resolved
ParseXS/Utilities.pm :
109-standard_XS_defs.t :
- remove context from S_croak_xs_usage similar to core commit
cb077ed296 .
CvGV doesn't need a context until 5.21.4 and commit
ae77754ae2 and
by then core's croak_xs_uage API has been long available and this
backport doesn't need to account for newer perls
- fix test where lack of having PERL_IMPLICIT_CONTEXT caused it to fail
Father Chrysostomos [Sat, 8 Nov 2014 01:52:41 +0000 (17:52 -0800)]
Update B::Deparse for last two commits
Father Chrysostomos [Fri, 7 Nov 2014 22:55:24 +0000 (14:55 -0800)]
Allow OPpTARGET_MY optimisation for x
Many operators have a special SV allocated in the pad which is used
for return values (the target). If we make that pad offset point to
a lexical variable, then we can optimise, say, $lexical = "$foo" into
just "$foo", where $lexical is stringify’s ‘target’. And pp_stringify
doesn’t need to know any better. We already do that for many ops.
This can be extended to x. Despite what the comment in op_private
says, list return values do not matter here, because the OPpTARGET_MY
optimisation only happens when the operator is in scalar context. And
the scalar code paths use TARG and push TARG on to the stack.
Father Chrysostomos [Fri, 7 Nov 2014 22:43:39 +0000 (14:43 -0800)]
Allow OPpTARGET_MY optimisation for vec
Many operators have a special SV allocated in the pad which is used
for return values (the target). If we make that pad offset point to
a lexical variable, then we can optimise, say, $lexical = "$foo" into
just "$foo", where $lexical is stringify’s ‘target’. And pp_stringify
doesn’t need to know any better. We already do that for many ops.
This can be extended to vec(). Despite what the comment in op_pri-
vate says, lvalue usage does not matter here, because the OPpTARGET_MY
optimisation only happens when the operator is in rvalue context. And
the rvalue code paths use TARG and push TARG on to the stack.
Daniel Dragan [Fri, 7 Nov 2014 06:15:18 +0000 (01:15 -0500)]
remove obsolete PL_apiversion
Commit
0e42d607f5 made PL_apiversion unused. Remove it to save memory in
interp struct.
Daniel Dragan [Fri, 7 Nov 2014 06:30:14 +0000 (01:30 -0500)]
remove cargo culted redundant PL_perldb test
Inseperable changes commit
8490252049 and specifically ML post
"Perldb rehaul" by Ilya Zakharevich added a completely redundant
"if(PL_perldb)" test. This was probably cargo culted from the code prior
to that patch where PL_perldb was a (I think) a bool. Neither GCC 4.6.3
nor VC 2003 optimized away the test. Before this patch, .text section in
perl521.dll compiled with VC 2003 was 0xc62d3 bytes of machine code long,
after 0xc6203.
Chris 'BinGOs' Williams [Fri, 7 Nov 2014 12:13:25 +0000 (12:13 +0000)]
Update Test-Harness to CPAN version 3.34
[DELTA]
3.34 2014-11-02
- Enable printing CPU times spent per test (Jarkko Hietaniemi)
Chris 'BinGOs' Williams [Fri, 7 Nov 2014 11:41:49 +0000 (11:41 +0000)]
Update Test-Simple to CPAN version 1.001009
Chris 'BinGOs' Williams [Fri, 7 Nov 2014 11:37:34 +0000 (11:37 +0000)]
Update Encode to CPAN version 2.64
[DELTA]
$Revision: 2.64 $ $Date: 2014/10/29 15:37:54 $
! t/utf8warnings.t MANIFEST
Retouch pull #26 so it works with perl < 5.14
! Encode.pm
+ t/utf8warnings.t
Pulled: Catch and re-issue utf8 warnings at a higher level
https://github.com/dankogai/p5-encode/pull/26
+ Encode.xs
Pulled: Validate continuations in the incremental UTF-X decoder
https://github.com/dankogai/p5-encode/pull/25
Jarkko Hietaniemi [Fri, 7 Nov 2014 11:40:01 +0000 (06:40 -0500)]
Revert "t/TEST: move our @found out to its real scope"
This reverts commit
448bc2e91e255b2610f23d9fe8092c9143dac28e.
Jarkko Hietaniemi [Fri, 7 Nov 2014 11:39:57 +0000 (06:39 -0500)]
Revert "t/TEST: $failure doesnt need to use defined"
This reverts commit
861a58daef615e7ade791b887911ef3caba8c539.
Jarkko Hietaniemi [Fri, 7 Nov 2014 11:39:56 +0000 (06:39 -0500)]
Revert "t/TEST: add a common timestamp"
This reverts commit
3c8571535150a64cf1163a15106d0f9e57fdd6a7.
Jarkko Hietaniemi [Fri, 7 Nov 2014 11:39:55 +0000 (06:39 -0500)]
Revert "t/TEST: comment some of the <$results> loop vars"
This reverts commit
861aa4195fddf02db2d2d1412c83a273daae9f05.
Jarkko Hietaniemi [Fri, 7 Nov 2014 11:39:54 +0000 (06:39 -0500)]
Revert "t/TEST: move do_nothing test after option-handling code"
This reverts commit
922487b2e3c980db625829f57958aac6a3e33552.
Jarkko Hietaniemi [Fri, 7 Nov 2014 11:39:54 +0000 (06:39 -0500)]
Revert "t/TEST: add -lxperf option to run tests under linux's perf stat"
This reverts commit
02a483e9608abd0f822d7c8ec6d64c07c4689e55.
Jarkko Hietaniemi [Fri, 7 Nov 2014 11:39:53 +0000 (06:39 -0500)]
Revert "t/TEST: simplify <$results> processing loop. - TAP13.1+"
This reverts commit
b8059a1db50cef0ea798275144b6d2f54a288946.
Jarkko Hietaniemi [Fri, 7 Nov 2014 11:39:52 +0000 (06:39 -0500)]
Revert "t/TEST: change timings Storable key: perf -> times, a better description"
This reverts commit
ba369d6f39f2f98f9e999dc978baeba4d4efba25.
Jarkko Hietaniemi [Fri, 7 Nov 2014 11:39:51 +0000 (06:39 -0500)]
Revert "t/TEST: suppress 2 uninitialized envars under make test.valgrind"
This reverts commit
e28ec392de528ba135a100709ce789a168286f86.
Jarkko Hietaniemi [Fri, 7 Nov 2014 11:39:49 +0000 (06:39 -0500)]
Revert "t/TEST: RFC start to separate out valgrind test support."
This reverts commit
08ac0af6a0260a3939c4904c299200adee71010d.
Jarkko Hietaniemi [Fri, 7 Nov 2014 11:39:47 +0000 (06:39 -0500)]
Father Chrysostomos [Fri, 7 Nov 2014 06:41:46 +0000 (22:41 -0800)]
Deparse Devel::Peek::Dump
I’m not sure how or where to test this. Maybe we should document this
‘accidental’ plug-in interface for B::Deparse and custom ops.
Father Chrysostomos [Fri, 7 Nov 2014 06:19:14 +0000 (22:19 -0800)]
Better B::Deparse warning for custom ops
Father Chrysostomos [Fri, 7 Nov 2014 06:05:41 +0000 (22:05 -0800)]
Update B::Deparse docs about BEGIN blocks
Father Chrysostomos [Fri, 7 Nov 2014 05:42:52 +0000 (21:42 -0800)]
Spell optimise consistently in Deparse pod
also add a missing hyphen.
Father Chrysostomos [Fri, 7 Nov 2014 05:42:00 +0000 (21:42 -0800)]
Mention Data::Dump::Streamer in B::Deparse docs
Father Chrysostomos [Fri, 7 Nov 2014 04:32:58 +0000 (20:32 -0800)]
[perl #77452] Deparse BEGIN blocks in the right place
In the op tree, a statement consists of a nextstate/dbstate op (of
class cop) followed by the contents of the statement. This cop is
created after the statement has been parsed. So if you have nested
statements, the outermost statement has the highest sequence number
(cop_seq). Every sub (including BEGIN blocks) has a sequence number
indicating where it occurs in its containing sub.
So
BEGIN { } #1
# seq 2
{
# seq 1
...
}
is indistinguishable from
# seq 2
{
BEGIN { } #1
# seq 1
...
}
because the sequence number of the BEGIN block is 1 in both examples.
By reserving a sequence number at the start of every block and using
it once the block has finished parsing, we can do this:
BEGIN { } #1
# seq 1
{
# seq 2
...
}
# seq 1
{
BEGIN { } #2
# seq 2
...
}
and now B::Deparse can tell where to put the blocks.
PL_compiling.cop_seq was unused, so this is where I am stashing
the pending sequence number.
Father Chrysostomos [Fri, 7 Nov 2014 02:06:01 +0000 (18:06 -0800)]
Increase $B::Concise::VERSION to 0.995