This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agoop.c: Don’t keep looping when we see potential common vars
Father Chrysostomos [Fri, 10 Oct 2014 04:54:12 +0000 (21:54 -0700)]
op.c: Don’t keep looping when we see potential common vars

When we loop through the list in LIST=..., once we have decided that
we need to do the more thorough check for common vars we don’t reverse
that decision based on subsequent ops, so there is no point in con-
tinuing to loop through them.

9 years agolvref.t: Remove special TODO code
Father Chrysostomos [Thu, 9 Oct 2014 22:53:53 +0000 (15:53 -0700)]
lvref.t: Remove special TODO code

We no longer have a plethora of to-do tests, so this specialised code
no longer gains us anything.

9 years agoStore internal state of state vars separately
Father Chrysostomos [Thu, 9 Oct 2014 22:51:18 +0000 (15:51 -0700)]
Store internal state of state vars separately

Use a separate pad entry to record whether a state variable has been
initialised, instead of using a flag on the value.

This prevents \$state_var = \$some_other_var from interfering with
that internal state.  It probably also fixes some cases with foreach
as well, but I have not confirmed.

9 years agolvref.t: More list and cond tests
Father Chrysostomos [Thu, 9 Oct 2014 21:07:35 +0000 (14:07 -0700)]
lvref.t: More list and cond tests

9 years agoDeparse lvalue references
Father Chrysostomos [Tue, 7 Oct 2014 05:12:27 +0000 (22:12 -0700)]
Deparse lvalue references

9 years agolvref.t: Remove temporary eval & skip
Father Chrysostomos [Sat, 4 Oct 2014 13:35:29 +0000 (06:35 -0700)]
lvref.t: Remove temporary eval & skip

9 years agolvref.t: Fix hash elem tests
Father Chrysostomos [Sat, 4 Oct 2014 13:31:11 +0000 (06:31 -0700)]
lvref.t: Fix hash elem tests

I was testing against a package hash for the ‘lexical’ tests.

9 years agoHandle state vars correctly in ref assignment
Father Chrysostomos [Sat, 4 Oct 2014 02:50:45 +0000 (19:50 -0700)]
Handle state vars correctly in ref assignment

Only \state(@_) was handling this correctly, as pp_lvavref
calls pp_padav.

9 years agolvref.t: Tests for \my assignment and scope exit
Father Chrysostomos [Fri, 3 Oct 2014 23:33:55 +0000 (16:33 -0700)]
lvref.t: Tests for \my assignment and scope exit

9 years agoRework lvref.t foreach tests
Father Chrysostomos [Fri, 3 Oct 2014 19:40:23 +0000 (12:40 -0700)]
Rework lvref.t foreach tests

Remove the to-do marker.

Add tests for package vars, too.

Redo the \my &a test.  I’ve decided not to bother with the ‘my &a’
syntax for now (if at all).  It is problematic and needs discussion.
(If ‘my &a’ is allowed in foreach, then it should be allowed else-
where, but ‘my &a;’ would call a stub.)

9 years agoGet foreach \&foo working
Father Chrysostomos [Fri, 3 Oct 2014 19:29:35 +0000 (12:29 -0700)]
Get foreach \&foo working

Previously these would crash.  Usually, &foo is wrapped in an entersub
op which gets converted to rv2cv when refgen applies lvalue context.
In foreach \&foo, there is no need for us to go the entersub route;
rather we pass the original rv2cv op directly to refgen without the
entersub wrapping.  So the resulting op tree is different.  S_lvref
was not expecting this alternate op tree.

9 years agoforeach \$var
Father Chrysostomos [Fri, 3 Oct 2014 05:38:27 +0000 (22:38 -0700)]
foreach \$var

Some passing tests are still marked to-do.  We need more tests still.

9 years agoAdd OPpLVREF_ITER flag
Father Chrysostomos [Fri, 3 Oct 2014 04:49:28 +0000 (21:49 -0700)]
Add OPpLVREF_ITER flag

An lvalue reference used as an iterator variable will be implemented
using an lvref op with this flag set.

9 years agoFix err message for $cond ? \bad : ... = ...
Father Chrysostomos [Thu, 2 Oct 2014 03:18:06 +0000 (20:18 -0700)]
Fix err message for $cond ? \bad : ... = ...

The error message code in S_lvref was assuming that it only handled
list assignment (which was originally the case), but

    $condition ? \pos : whatever = ...

goes through that same code path, and that is a scalar assignment.

So pass the assignment type through to S_lvref.

9 years agoSubroutine reference assignment
Father Chrysostomos [Thu, 2 Oct 2014 03:00:10 +0000 (20:00 -0700)]
Subroutine reference assignment

9 years agolvref.t: Repeat bad ref tests with list assignment
Father Chrysostomos [Thu, 2 Oct 2014 01:15:16 +0000 (18:15 -0700)]
lvref.t: Repeat bad ref tests with list assignment

List assignment goes through a different code path.  The errors come
from magic_setlvref in that case, not pp_refassign.

9 years agolvref.t: do-block err msg is no longer to-do
Father Chrysostomos [Wed, 1 Oct 2014 05:28:48 +0000 (22:28 -0700)]
lvref.t: do-block err msg is no longer to-do

The previous commit’s rearrangement of things fixed this, too.

9 years agoMake \( ?: ) assignment work
Father Chrysostomos [Wed, 1 Oct 2014 05:20:56 +0000 (22:20 -0700)]
Make \( ?: ) assignment work

When I first implemented list assignment to lvalue references, I
thought I could simply modify the kids of the refgen op (\) in one
spot.  But things like ?: make it necessary to do this recursively.
So all that code for turning thingies into lvrefs has been moved into
a separate function patterned after op_lvalue but handling only the
lvref cases.

(I thought about combining it with op_lvalue’s switch statement, but
that would require ‘if(type == OP_LVREF) goto nomod;’ too many times,
which would be harder to maintain.)

9 years agolvref.t: Remove unnecessary evals
Father Chrysostomos [Tue, 30 Sep 2014 17:28:32 +0000 (10:28 -0700)]
lvref.t: Remove unnecessary evals

9 years agoGet basic $cond ? \$a : \$b = ... working
Father Chrysostomos [Tue, 30 Sep 2014 17:27:34 +0000 (10:27 -0700)]
Get basic $cond ? \$a : \$b = ... working

When I started working on lvalue references, I envisioned having all
scalar assignments pass through pp_refassign.  A refassign op repre-
sents the initial backslash on the lhs *and* the equals sign.  For
cases like this, there is no single refgen on the lhs.  It turns out
that the approach I am using for list assignments (where the lhs
becomes an lvref op that returns a magic scalar that does the aliasing
when assigned to) is the easiest way to get this working, too.

All this commit has to do is allow ‘sassign’ lvalue context to apply
to srefgen and fix the completely broken to-do tests.  (I have a ten-
dency to write broken to-do tests, as I have no way of testing them at
the time.)

9 years agoAssignment to \(@array)
Father Chrysostomos [Tue, 30 Sep 2014 05:21:21 +0000 (22:21 -0700)]
Assignment to \(@array)

This is a slurpy lvalue that gobbles up all the rhs elements, which
are expected to be references.  So \(@a)=\(@b) makes @a share the
same elements as @b.

We implement this by pushing a null on to the stack as a special
marker that pp_aassign will recognise.

I decided to change the wording for the \local(@a)=... error
slightly, from what my to-do tests had.

Some of the other to-do tests were badly written and had to be
fixed up a bit.

9 years agolvavref needs OPpLVAL_INTRO and OPpPAD_STATE
Father Chrysostomos [Tue, 30 Sep 2014 05:23:22 +0000 (22:23 -0700)]
lvavref needs OPpLVAL_INTRO and OPpPAD_STATE

9 years agoAdd lvavref op type
Father Chrysostomos [Tue, 30 Sep 2014 04:43:53 +0000 (21:43 -0700)]
Add lvavref op type

This will be used for slurpy array ref assignments.  \(@a) = \(@b)
will make @a share the same elements as @b.

9 years agolvref is actually a baseop/unop
Father Chrysostomos [Tue, 30 Sep 2014 04:40:28 +0000 (21:40 -0700)]
lvref is actually a baseop/unop

When used for pad vars, it is childless.

9 years agoList assignment to array and hash refs
Father Chrysostomos [Tue, 30 Sep 2014 01:03:57 +0000 (18:03 -0700)]
List assignment to array and hash refs

(\@a,\%h)=... works, but \(@a) and \(%h) do not.  \(%h) correctly
croaks.  (\local @a, \local %h)=... also works.

9 years agoRenumber OPpLVREF_TYPE
Father Chrysostomos [Mon, 29 Sep 2014 22:48:24 +0000 (15:48 -0700)]
Renumber OPpLVREF_TYPE

to avoid conflicting with OPpPAD_STATE.

9 years agoAssignment to \local @array and \local %hash
Father Chrysostomos [Mon, 29 Sep 2014 05:17:27 +0000 (22:17 -0700)]
Assignment to \local @array and \local %hash

Doesn’t work with lhs parentheses yet.

9 years agolvref.t: Tests for localised arrays and hashes
Father Chrysostomos [Sun, 28 Sep 2014 18:45:57 +0000 (11:45 -0700)]
lvref.t: Tests for localised arrays and hashes

9 years agolvref.t: Test assigning non-array to array
Father Chrysostomos [Sun, 28 Sep 2014 07:53:19 +0000 (00:53 -0700)]
lvref.t: Test assigning non-array to array

Same with hashes.

9 years agoSimple \@array and \%hash assignment
Father Chrysostomos [Sun, 28 Sep 2014 07:52:45 +0000 (00:52 -0700)]
Simple \@array and \%hash assignment

Parentheses do not work yet.  Neither does local.

9 years agolvref.t: To-do tests for hashes
Father Chrysostomos [Sun, 28 Sep 2014 07:42:09 +0000 (00:42 -0700)]
lvref.t: To-do tests for hashes

Concerning the error message tests, ‘parenthesized hash’ would be more
helpful than ‘hash dereference’ or ‘private hash’ (as would be provided
by OP_DESC), as %foo doesn’t look like a hash dereference and ‘private
hash’ suggests that \%foo= won’t work, whereas it will.

9 years agoAdd priv flags for the type of lvalue ref
Father Chrysostomos [Sun, 28 Sep 2014 05:03:25 +0000 (22:03 -0700)]
Add priv flags for the type of lvalue ref

9 years agolvref.t: To-do tests for array ref assignment
Father Chrysostomos [Sun, 28 Sep 2014 01:44:57 +0000 (18:44 -0700)]
lvref.t: To-do tests for array ref assignment

The evals are temporary.  Some of the tests don’t even make sense
with the evals; they are more placeholders and reminders for now
that tests.

9 years agopp.c: Fold SvIV into S_localise_aelem_lval
Father Chrysostomos [Sat, 27 Sep 2014 21:17:09 +0000 (14:17 -0700)]
pp.c: Fold SvIV into S_localise_aelem_lval

All three callers were doing SvIV, so we can do it in one spot.

9 years agopp.c: Some branch prediction hints
Father Chrysostomos [Sat, 27 Sep 2014 21:15:50 +0000 (14:15 -0700)]
pp.c: Some branch prediction hints

9 years agoAssignment to hash element refs
Father Chrysostomos [Sat, 27 Sep 2014 21:15:00 +0000 (14:15 -0700)]
Assignment to hash element refs

9 years agopp.c: Consolidate some local aelem code
Father Chrysostomos [Sat, 27 Sep 2014 18:07:35 +0000 (11:07 -0700)]
pp.c: Consolidate some local aelem code

In the process, avoid a redundant av_fetch for \local$a[0]= and
\local($a[0])=.

9 years agopp.c:pp_lvrefslice: Unused var
Father Chrysostomos [Sat, 27 Sep 2014 17:49:46 +0000 (10:49 -0700)]
pp.c:pp_lvrefslice: Unused var

9 years ago\local $a[$ix] assignment
Father Chrysostomos [Sat, 27 Sep 2014 17:49:24 +0000 (10:49 -0700)]
\local $a[$ix] assignment

9 years ago\@array[@slice] assignment
Father Chrysostomos [Fri, 26 Sep 2014 17:40:19 +0000 (10:40 -0700)]
\@array[@slice] assignment

plus changes to the aelem tests to check rhs context.

I did \local @a[@s] at the same time, since I was practically copying
and pasting code from aslice (ok, not quite).

9 years agopp.c: Dodge compiler warning
Father Chrysostomos [Fri, 26 Sep 2014 05:13:33 +0000 (22:13 -0700)]
pp.c: Dodge compiler warning

9 years agolvrefslice gets OPpLVAL_INTRO
Father Chrysostomos [Fri, 26 Sep 2014 05:10:39 +0000 (22:10 -0700)]
lvrefslice gets OPpLVAL_INTRO

9 years agoAdd lvrefslice op type
Father Chrysostomos [Fri, 26 Sep 2014 05:08:15 +0000 (22:08 -0700)]
Add lvrefslice op type

9 years agoAssignment to array elem refs
Father Chrysostomos [Fri, 26 Sep 2014 03:34:11 +0000 (20:34 -0700)]
Assignment to array elem refs

9 years ago\local $scalar assignment
Father Chrysostomos [Thu, 25 Sep 2014 23:10:14 +0000 (16:10 -0700)]
\local $scalar assignment

9 years agoMake \($x,$y) assignment work
Father Chrysostomos [Thu, 25 Sep 2014 20:10:22 +0000 (13:10 -0700)]
Make \($x,$y) assignment work

This applies to \ with multiple kids (refgen).  Up till now,
op_lvalue_flags only handled srefgen (single refgen).

Before I was converting srefgen to lvref and nulling the kid op:

  srefgen
    ex-list
      rv2sv
        gv

became:

  lvref
    ex-list
      ex-rv2sv
        gv

Now I’m converting the kid instead and nulling the srefgen:

  ex-srefgen
    ex-list
      lvref
        gv

so that the same code can apply to refgen:

  refgen
    ex-list
      pushmark
      rv2sv
        gv
      rv2sv
        gv

becomes

  ex-refgen
    ex-list
      ex-pushmark
      lvref
        gv
      lvref
        gv

9 years agoList assignment to lexical scalar refs
Father Chrysostomos [Thu, 25 Sep 2014 15:19:13 +0000 (08:19 -0700)]
List assignment to lexical scalar refs

\($x,$y)=... does not work yet, but \(my $x) and (\$x, \$y) do.

9 years agoFix assertion failure with ... ? \$a : \$b = ...
Father Chrysostomos [Thu, 25 Sep 2014 05:13:01 +0000 (22:13 -0700)]
Fix assertion failure with ... ? \$a : \$b = ...

Because both branches have a srefgen, this was treated as a scalar
reference assignment, which is usually handled by refassign.  But
refassign expects the thing on the lhs to be srefgen, not a cond_expr.

The logic for propagating the assignment type must not propagate the
‘ASSIGN_REF’ type outward.  Only list context propagates outward.
Eventually, this will be handled by sassign and the cond_expr will
have lvref kids.  (It’s too complicated for refassign, which is the
optimised form that combines \ and = into one op.)

For now, this commit just fixes the assertion failure without making
this type of assignment work yet.

9 years agoop.c: Apply spair optimisation to \% \@ \&
Father Chrysostomos [Wed, 24 Sep 2014 23:21:03 +0000 (16:21 -0700)]
op.c: Apply spair optimisation to \% \@ \&

The ‘spair’ (scalar/single pair) optimisation applies to a few operat-
ors for which there are actually pairs of ops, one for scalars or sin-
gle items, the other for lists.  refgen is one of them.

When taking references, hashes, arrays and subroutines are single
items, just like scalars, so they can go through the ‘single’ code and
benefit, too.

refassign will also benefit from this, as \@a = [] (not yet imple-
mented) should provide scalar context to the right-hand side, and this
avoids the need for special cases (because srefgen with the initial s
provides scalar context).

(This optimisation could have applied to aggregates passed to cho(m)p,
but it results in incorrect messages like ‘Uninitialized value in sca-
lar chomp’ for chomp @_, so I’ve left it for now.)

9 years agoUse ‘Can’t modify reference to...’ for refassign, too
Father Chrysostomos [Mon, 29 Sep 2014 05:50:57 +0000 (22:50 -0700)]
Use ‘Can’t modify reference to...’ for refassign, too

9 years agoop.c: diag_listed_as for ‘Can't modify ref’
Father Chrysostomos [Wed, 24 Sep 2014 21:22:38 +0000 (14:22 -0700)]
op.c: diag_listed_as for ‘Can't modify ref’

9 years agolvref.t: Test ‘Can't modify reference to...’
Father Chrysostomos [Wed, 24 Sep 2014 21:20:48 +0000 (14:20 -0700)]
lvref.t: Test ‘Can't modify reference to...’

9 years agoList assignment to package scalar ref
Father Chrysostomos [Wed, 24 Sep 2014 20:22:49 +0000 (13:22 -0700)]
List assignment to package scalar ref

\ on the lhs returns a special magical scalar with set-magic that does
the aliasing.

I considered having a separate abind op that would be like aassign,
but different.  However, I realised that for ($x, \$y) = ... to work
it would have to duplicate all of aassign.  So I went with the sim-
pler magic implementation.

9 years agoCapitalise magic descriptions consistently
Father Chrysostomos [Wed, 24 Sep 2014 08:45:47 +0000 (01:45 -0700)]
Capitalise magic descriptions consistently

9 years agoAdd lvref magic type
Father Chrysostomos [Wed, 24 Sep 2014 08:42:30 +0000 (01:42 -0700)]
Add lvref magic type

I just couldn’t resist using the backslash for the character, even
though I had to tweak mg_vtable.pl to make it work.

9 years agoAdd lvref op type
Father Chrysostomos [Wed, 24 Sep 2014 07:58:23 +0000 (00:58 -0700)]
Add lvref op type

9 years agolvref.t: More parenthesized scalar ref tests
Father Chrysostomos [Wed, 24 Sep 2014 07:19:33 +0000 (00:19 -0700)]
lvref.t: More parenthesized scalar ref tests

These tests are actually nonsensical with the evals, but they currently
cause syntax errors.  Ultimately they are placeholders and reminders,
so it doesn’t matter.

9 years agolvref.t: Some assignments with mixed lhs
Father Chrysostomos [Wed, 24 Sep 2014 05:33:09 +0000 (22:33 -0700)]
lvref.t: Some assignments with mixed lhs

9 years agoImplement \my $x = ...
Father Chrysostomos [Mon, 22 Sep 2014 06:11:32 +0000 (23:11 -0700)]
Implement \my $x = ...

9 years agolvref.t: Test \$foo = \*bar
Father Chrysostomos [Sun, 21 Sep 2014 23:04:23 +0000 (16:04 -0700)]
lvref.t: Test \$foo = \*bar

9 years agolvref.t: To-do tests for foreach \
Father Chrysostomos [Sun, 21 Sep 2014 22:04:20 +0000 (15:04 -0700)]
lvref.t: To-do tests for foreach \

9 years agolvret.t: To-do tests for \local $scalar=
Father Chrysostomos [Sun, 21 Sep 2014 21:58:15 +0000 (14:58 -0700)]
lvret.t: To-do tests for \local $scalar=

9 years agoWhen making lex alias, don’t free old var too soon
Father Chrysostomos [Sun, 21 Sep 2014 21:43:37 +0000 (14:43 -0700)]
When making lex alias, don’t free old var too soon

It could be exactly the same variable, and the reference on the rhs
could be weak:

use feature ":all";
use Scalar::Util 'weaken';
my $a;
weaken($r = \$a);
\$a = $r;
__END__
Lvalue references are experimental at - line 5.
Segmentation fault: 11

9 years agolvref.t: To-do test for PADSTALE handling
Father Chrysostomos [Sun, 21 Sep 2014 21:23:00 +0000 (14:23 -0700)]
lvref.t: To-do test for PADSTALE handling

9 years agoSimple package scalar lvalue refs
Father Chrysostomos [Sun, 21 Sep 2014 20:56:01 +0000 (13:56 -0700)]
Simple package scalar lvalue refs

\$::x = ... works, but not \local $x yet.

9 years agolvref.t: Tests for error massages
Father Chrysostomos [Sun, 21 Sep 2014 19:29:30 +0000 (12:29 -0700)]
lvref.t: Tests for error massages

9 years agolvref.t: Remove to-do and eval from passing test
Father Chrysostomos [Sun, 21 Sep 2014 18:19:41 +0000 (11:19 -0700)]
lvref.t: Remove to-do and eval from passing test

This one passing test was failing inside the eval because closures
are not yet supported.  (That’s why I added explicit closure tests
in the previous commit.)

9 years agolvref.t: To-do tests for closures
Father Chrysostomos [Sun, 21 Sep 2014 18:16:33 +0000 (11:16 -0700)]
lvref.t: To-do tests for closures

9 years agoDocument lvalue ref diagnostics
Father Chrysostomos [Sun, 21 Sep 2014 07:22:41 +0000 (00:22 -0700)]
Document lvalue ref diagnostics

Also, use ‘a SCALAR reference’ rather than ‘a scalar reference’, to
match the style used elsewhere.

9 years agoFirst stab at lexical scalar aliases
Father Chrysostomos [Sat, 20 Sep 2014 21:49:04 +0000 (14:49 -0700)]
First stab at lexical scalar aliases

No \my$x= yet.  Only my $x; \$x =....

It does not work properly with variables closed over from outside;
hence, all the to-do tests fail still, since they do the assign-
ment in evals.

But this much works:

$ ./miniperl -Ilib -Mfeature=:all -e 'my $m; \$m = \$n; warn \$m; warn \$n'
Lvalue references are experimental at -e line 1.
SCALAR(0x7fa04b805510) at -e line 1.
SCALAR(0x7fa04b805510) at -e line 1.

9 years agoop.c: In newBINOP, set up op_last before CHECKOP
Father Chrysostomos [Sun, 21 Sep 2014 06:33:26 +0000 (23:33 -0700)]
op.c: In newBINOP, set up op_last before CHECKOP

Set up op_last pointers in newBINOP before calling the op-specific
ck_* routine.

That way, since this op sub-tree is well-formed from the outset, we
don’t need as much fix-up code elsewhere to account for the case where
the binop has been embedded inside a larger op tree (state var ini-
tialisation).

The repetition operator is an odd bird.  If the lhs is a list of one
item, it is effectively an unop, though still of class binop.  Though
op_last would usually point to the last immediate child, it ended
up null instead.  B::Deparse was written to expect that, so let’s
keep it that way by setting it to null in ck_repeat, now that the
last = first->sibling assignment in newBINOP (which used to do it)
happens earlier.

9 years agoIncrease $Opcode::VERSION to 1.29
Father Chrysostomos [Sat, 20 Sep 2014 20:48:48 +0000 (13:48 -0700)]
Increase $Opcode::VERSION to 1.29

9 years agoAdd refassign op type
Father Chrysostomos [Sat, 20 Sep 2014 20:47:58 +0000 (13:47 -0700)]
Add refassign op type

9 years agoop.c:ck_spair: Remove redundant checks
Father Chrysostomos [Sat, 20 Sep 2014 20:27:47 +0000 (13:27 -0700)]
op.c:ck_spair: Remove redundant checks

Neither the av nor the hv ops have the OA_RETSCALAR flag, so these
checks are unreachable.

These checks go all the way back to a0d0e21e (perl 5.000).

9 years agoTo-do tests for scalar lvalue refs
Father Chrysostomos [Sat, 20 Sep 2014 18:46:14 +0000 (11:46 -0700)]
To-do tests for scalar lvalue refs

9 years agoIncrease $warnings::VERSION to 1.27
Father Chrysostomos [Sat, 20 Sep 2014 18:16:08 +0000 (11:16 -0700)]
Increase $warnings::VERSION to 1.27

9 years agoAdd experimental::lvalue_refs warnings category
Father Chrysostomos [Sat, 20 Sep 2014 18:15:18 +0000 (11:15 -0700)]
Add experimental::lvalue_refs warnings category

9 years agoIncrease $feature::VERSION to 1.38
Father Chrysostomos [Sat, 20 Sep 2014 18:13:58 +0000 (11:13 -0700)]
Increase $feature::VERSION to 1.38

9 years agoAdd lvalue_refs feature feature
Father Chrysostomos [Sat, 20 Sep 2014 18:12:37 +0000 (11:12 -0700)]
Add lvalue_refs feature feature

9 years agoRemove trailing space from perlipc.pod.
Shlomi Fish [Sun, 9 Jun 2013 22:12:08 +0000 (01:12 +0300)]
Remove trailing space from perlipc.pod.

For: RT #122938 (first patch)

9 years agoremove trailing whitespace.
Shlomi Fish [Fri, 10 Oct 2014 12:33:39 +0000 (15:33 +0300)]
remove trailing whitespace.

For: RT #122942 (first patch)

9 years agoUpdate libnet to version 3.02
Steve Hay [Fri, 10 Oct 2014 23:20:32 +0000 (00:20 +0100)]
Update libnet to version 3.02

This skips the interactive prompt() from the Makefile.PL reported by bulk88
(and removes the t/external/*.t tests which will not be run as a result).

9 years agoUpdate EXCLUDED files list for libnet following 2e1731446c
Steve Hay [Fri, 10 Oct 2014 23:11:44 +0000 (00:11 +0100)]
Update EXCLUDED files list for libnet following 2e1731446c

9 years agomove dMY_CXT in dlutils.c closer to first use
Daniel Dragan [Fri, 10 Oct 2014 20:11:25 +0000 (16:11 -0400)]
move dMY_CXT in dlutils.c closer to first use

By computing dMY_CXT right before its first and usually last use, my_cxt
pointer doesn't need to be carried across function calls in SaveError. This
frees a C stack auto and/or register from being saved and restored in
SaveError. On VC 2003 32 bits -O1 threaded, the machine code size in bytes
dropped from 0x72 to 0x70 after this patch.

9 years agoSet PERL_MM_USE_DEFAULT in make_ext.pl
Father Chrysostomos [Fri, 10 Oct 2014 21:51:45 +0000 (14:51 -0700)]
Set PERL_MM_USE_DEFAULT in make_ext.pl

In the perl core, we shouldn’t be getting messages like this when
trying to build perl:

Should I do external tests?
These tests will fail if there is no internet connection or if a firewall
blocks or modifies some traffic.
[y/N] [n]

libnet’s Makefile.PL now does that.  To make it easier to maintain
such Makefiles.PL to work both on CPAN and in the core, set
PERL_MM_USE_DEFAULT temporarily in make_ext.pl when running the
Makefile.PL.

9 years agooptimize & rmv from public API Perl_tmps_grow and related code
Daniel Dragan [Fri, 10 Oct 2014 17:29:33 +0000 (13:29 -0400)]
optimize & rmv from public API Perl_tmps_grow and related code

Previously in PUSH_EXTEND_MORTAL__SV_C, "PL_tmps_ix + 1" would execute
twice, once for the nonmutable if(>=), then again after the potential
tmps_grow call. tmps_grow has an unused return register/void proto, put it
to use by returning ix.  Also change tmps_grow to take the result of
"PL_tmps_ix + the constant (usually 1) or non-constant (EXTEND_MORTAL)".
This avoid having to put the constant twice in machine code, once for the
if test, 2nd time for extend length param for tmps_grow call. For
non-constant/EXTEND_MORTAL usage, it allows the C optimizer to have the
length var to go out of liveness sooner if possible. Also the var used for
the if(>=) test is more likely to be in a register than length var.
So "if test variable" is closer on hand to the CPU than length var. In some
cases, if non-const len var isn't used again, it becomes the "ix" variable
by having PL_tmps_ix added to it. Change sv_2mortal to return sv instead
of NULL to remove a unique branch/block of machine code that assigns 0 to
return variable (Visual C didn't figure out return sv == returned NULL,
not sv). See also [perl #121845].

9 years agoDeparse split-to-our-array correctly
Father Chrysostomos [Fri, 10 Oct 2014 20:56:24 +0000 (13:56 -0700)]
Deparse split-to-our-array correctly

$ ./perl -Ilib -MO=Deparse -e 'our @x = split //, $a'
@x = split(//, $a, 0);

The ‘our’ disappears because ‘split’ swallows up the assignment and
writes to @x directly.  But the result is that no OUR_INTRO flag is
left in the op tree.

Fixing this based on the current op tree is very complicated.  So
this commit sets the flag on the split op and makes B::Deparse
look for it.

9 years agotoke.c:S_parse_opt_lexvar: Don’t use null terminator
Father Chrysostomos [Fri, 10 Oct 2014 03:35:35 +0000 (20:35 -0700)]
toke.c:S_parse_opt_lexvar: Don’t use null terminator

allocmy no longer depends on it.

9 years agoop.c:allocmy: Remove obsolete cmnts and assert
Father Chrysostomos [Fri, 10 Oct 2014 03:35:05 +0000 (20:35 -0700)]
op.c:allocmy: Remove obsolete cmnts and assert

We are no longer depending on strlen at all.  The name[2] check was
removed in 2009 in d6447115b.

9 years agoop.c:allocmy: Don’t depend on null termination
Father Chrysostomos [Fri, 10 Oct 2014 03:32:58 +0000 (20:32 -0700)]
op.c:allocmy: Don’t depend on null termination

This function has a len argument, but still depends on its argument’s
being null-terminated in one spot.  (All other parts of the function
use the length.)

9 years agoDeparse local our LIST
Father Chrysostomos [Thu, 9 Oct 2014 19:55:46 +0000 (12:55 -0700)]
Deparse local our LIST

The ‘local’ was being omitted.  I missed the list form of
‘local our’ in commit f351564117.

9 years agoUpdate libnet to CPAN version 3.01
Chris 'BinGOs' Williams [Fri, 10 Oct 2014 12:37:54 +0000 (13:37 +0100)]
Update libnet to CPAN version 3.01

  [DELTA]

libnet 3.01  -- Thu Oct 09 2014

  * Require IO::Socket::SSL >= 1.999 to protect against a bad version (0.30) of
    IO::Socket::IP and hopefully fix another bunch of CPAN Testers failures.

libnet 3.00  -- Thu Oct 09 2014

  * Skip Perl Critic, Pod and Pod Coverage tests unless AUTHOR_TESTING.
    [Resolves CPAN RT#99399]
  * Synchronize all $VERSIONs to the distribution's version number, bumping that
    to 3.00 so that no $VERSIONs end up going backwards.

libnet 1.30  -- Wed Oct 08 2014

  * Sigh. Fix PAUSE indexing problem again. Net::SMTP::SSL is already used by
    Net-SMTP-SSL.

libnet 1.29  -- Wed Oct 08 2014

  * Fix PAUSE indexing problem. Net::POP3::_SSLified and Net::SMTP::_SSLified
    are already used by Net-SSLGlue.

libnet 1.28  -- Wed Oct 08 2014

  * Improve code()/message() initialization and error handling in Net::Cmd
    [Tom Metro; resolves CPAN RT#14875]
  * Don't use the ALLO command on FTP servers that don't support it.  [Resolves
    CPAN RT#95717]
  * Stop Makefile.PL from requiring interactive configuration when running via
    cpan, cpanp or cpanm: just accept all defaults in these cases, as when
    running non-interactively.  [Resolves CPAN RT#48966]
  * Add optional POD coverage testing.
  * Add optional POD testing.
  * Add optional Perl::Critic testing.
  * Make code Perl::Critic clean.
  * Move Net/*.pm into lib/Net/ sub-directory within distribution. This is the
    usual layout style these days.
  * Change Net::SMTP::auth() so that it now falls back to another supported AUTH
    method if a given AUTH method fails.  [Ivan Baktsheev; closes PR#3]
  * Change Net::SMTP::auth() so that it uses the SMTP AUTH mechanism(s)
    specified in the Authen::SASL object if one is provided instead of a
    username.   If a plain text username is specified then use the first
    reported SMTP AUTH method supported, as usual.  [Ewen McNeill; resolves CPAN
    RT#58002]
  * Add support for IPv6 and SSL to Net::FTP, Net::NNTP, Net::POP3 and
    Net::SMTP.  These features are only available if the user has

      a recent IO::Socket::SSL for SSL support
      a recent IO::Socket::IP or an older IO::Socket::INET6 for IPv6 support

    If no SSL module is available it will work as before, but attempts to use
    the SSL functionality will result in an error message.  If no IPv6 modules
    are available it will just use IPv4 as before.  With IPv6 modules installed
    one can of course still access IPv4 hosts.
    [Steffen Ullrich; resolves CPAN RT#93823]

9 years agoUpdate Socket to CPAN version 2.016
Chris 'BinGOs' Williams [Fri, 10 Oct 2014 12:30:39 +0000 (13:30 +0100)]
Update Socket to CPAN version 2.016

  [DELTA]

2.016   2014/10/08 21:53:10
        [BUGFIXES]
         * Wrap configure tests in a {} block in case of C99-deficient
           compilers (RT99363)
         * #include <stddef.h> so that NULL definitely exists (RT98248)
         * Need to pass NI_NUMERICSERV during unit tests for some OSes not to
           error (VMS) (RT98217)

9 years agoUpdate JSON-PP to CPAN version 2.27300
Chris 'BinGOs' Williams [Fri, 10 Oct 2014 12:22:42 +0000 (13:22 +0100)]
Update JSON-PP to CPAN version 2.27300

  [DELTA]

2.27300
  - fixed a problem about substr in perl 5.8.6 and below
    many people report this issue and patched by haarg[at]haarg.org

9 years agofix WinCE build
Daniel Dragan [Thu, 9 Oct 2014 23:43:13 +0000 (19:43 -0400)]
fix WinCE build

locale changes in 2014 broke WinCE build. localconv() doesn't exist on
WinCE. locale.h from celib has to be included for
setlocale()/xcesetlocale() and LC_* constants.

9 years agoperldelta for 11f610b5c537
Tony Cook [Fri, 10 Oct 2014 00:55:35 +0000 (11:55 +1100)]
perldelta for 11f610b5c537

9 years agoremove dl_nonlazy global if unused in Dynaloader
Daniel Dragan [Wed, 8 Oct 2014 05:42:23 +0000 (01:42 -0400)]
remove dl_nonlazy global if unused in Dynaloader

Saves an int of memory per interp. Removes a env var lookup, and on Win32
also remove a registry check for PERL_DL_NONLAZY. This speeds up start up
time of interp a tiny bit. While platforms other than hpux and dlopen use
RTLD_LAZY, they use it unconditionally ignoring PERL_DL_NONLAZY. I am not
judging that decision in this commit.

9 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>
9 years agoperldelta for 2c2d7daa9519, a6d695237c4c
Tony Cook [Thu, 9 Oct 2014 00:59:55 +0000 (11:59 +1100)]
perldelta for 2c2d7daa9519a6d695237c4c

9 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.