platform/upstream/perl.git
11 years agoperlapi.pod: Clarify what a parameter means
Karl Williamson [Sat, 20 Oct 2012 22:22:05 +0000 (16:22 -0600)]
perlapi.pod: Clarify what a parameter means

11 years agofold_grind.t: Set $| if debugging
Karl Williamson [Sat, 20 Oct 2012 22:19:49 +0000 (16:19 -0600)]
fold_grind.t: Set $| if debugging

11 years agoAdd comment
Karl Williamson [Sat, 20 Oct 2012 22:18:32 +0000 (16:18 -0600)]
Add comment

11 years agoregen/mk_PL_charclass.pl: Move code to subroutine
Karl Williamson [Sat, 20 Oct 2012 22:15:48 +0000 (16:15 -0600)]
regen/mk_PL_charclass.pl: Move code to subroutine

This code is for just this property and was kludged in to be executed in
the general loop.  It makes more sense to it to be in the subroutine
that handles the property that was just added in a prior commit.

It also changes the output slightly.  The Latin1 sharp S isn't a
non-final fold, unlike what was said previously

11 years agomktables: Don't generate no-longer needed tables
Karl Williamson [Sat, 20 Oct 2012 22:00:21 +0000 (16:00 -0600)]
mktables: Don't generate no-longer needed tables

These internal tables were only used in regen code, and those have been
modified to not use them; so can be removed.

11 years agoregen/mk_PL_charclass.pl: White-space only; no code changes
Karl Williamson [Sat, 20 Oct 2012 21:59:33 +0000 (15:59 -0600)]
regen/mk_PL_charclass.pl: White-space only; no code changes

Indent a newly formed block

11 years agoregen/mk_PL_charclass.pl: Generate our own tables for certain properties
Karl Williamson [Sat, 20 Oct 2012 21:25:18 +0000 (15:25 -0600)]
regen/mk_PL_charclass.pl: Generate our own tables for certain properties

The two affected inversion lists are used only in regen.  It is wasteful
to have mktables generate these, as they aren't used elsewhere and just
take up disk space.

11 years agoregen/mk_invlists.pl: Generate our own tables for certain properties
Karl Williamson [Sat, 20 Oct 2012 21:13:22 +0000 (15:13 -0600)]
regen/mk_invlists.pl: Generate our own tables for certain properties

The two affected inversion lists are used only in regen.  It is wasteful
to have mktables generate these, as they aren't used elsewhere and just
take up disk space.

11 years agoExclude signal-related symbols on VMS without home-grown signalling.
Craig A. Berry [Sat, 20 Oct 2012 22:27:01 +0000 (17:27 -0500)]
Exclude signal-related symbols on VMS without home-grown signalling.

config.h defines KILL_BY_SIGPRC when we are using our own signal
handling functions based on the sys$sigprc system service.  But
when *not* doing that, and since using makedef.pl to define our
exportable symbols, we have not properly excluded the symbols
involved in the home-grown implementation.  It's not a common
configuration, but since it's configurable, it should work, and
now it will.

11 years agoregen/regcharclass.pl: White space only; no code changes
Karl Williamson [Sat, 20 Oct 2012 19:10:41 +0000 (13:10 -0600)]
regen/regcharclass.pl: White space only; no code changes

Indent as a result of a new block

11 years agoregen/regcharclass.pl: Generate better code for some macros
Karl Williamson [Sat, 20 Oct 2012 19:04:51 +0000 (13:04 -0600)]
regen/regcharclass.pl: Generate better code for some macros

This commit revamps the recently added function calculate_mask() to not
just work to give a single mask/compare value for its input and fail if
there are none, but to return a list of masks/compares when the set can
be split up into subsets that each can be represented by a mask/compare.
If this list taken as a whole yields fewer branches than what we get
otherwise, it is better code, and is used.

Said another way, what we had there before was all or nothing; this
works to improve things even if we can't do it all.

11 years agoregen/regcharclass.pl: White-space only; no code changes
Karl Williamson [Sat, 20 Oct 2012 17:27:44 +0000 (11:27 -0600)]
regen/regcharclass.pl: White-space only; no code changes

This outdents some code that is no longer contained in a block, and
reflows the comments to 80 columns;

11 years agoregen/regcharclass.pl: Refactor a 'return' slightly
Karl Williamson [Sat, 20 Oct 2012 17:25:50 +0000 (11:25 -0600)]
regen/regcharclass.pl: Refactor a 'return' slightly

Instead of having a common return at the end of the function, this does
that same return at an intermediate point.  The reason is that a future
commit will change the final return somewhat, and this seemed the
clearest way to go.

11 years agoTweak psect attributes in VMS initialization code.
Craig A. Berry [Sat, 20 Oct 2012 03:16:17 +0000 (22:16 -0500)]
Tweak psect attributes in VMS initialization code.

noexe is the default and older compilers can't process it, so don't
explicitly specify it.

nopic is mandatory but non-default on VAX and is silently ignored
on Alpha and Itanium, so go ahead and specify it explicitly.

11 years agoShorten command length when generating linker options file.
Craig A. Berry [Sat, 20 Oct 2012 02:38:04 +0000 (21:38 -0500)]
Shorten command length when generating linker options file.

The MINIPERL macro expands to 40 characters longer than the
MINIPERLQ macro in order to include Cwd, but Cwd isn't needed
when doing a simple one-liner, and the extra length can make us
exceed the command buffer on older VMS systems.

11 years agoAdd epigraph link for 5.17.5
Florian Ragwitz [Sat, 20 Oct 2012 17:47:33 +0000 (14:47 -0300)]
Add epigraph link for 5.17.5

11 years agoMerge branch 'post-release-5.17,5' into blead
Florian Ragwitz [Sat, 20 Oct 2012 17:46:19 +0000 (14:46 -0300)]
Merge branch 'post-release-5.17,5' into blead

* post-release-5.17,5:
  Bump the version to 5.17.6
  Add a new perldelta
  Add the 5.17.5 epigraph
  Add 5.17.5 to perlhist
  Update Module::CoreList for 5.17.5
  Finalise perldelta

Conflicts:
pod/perldelta.pod

11 years agofix off-by-one error in key detection logic for uninitialized warnings
Yves Orton [Sat, 20 Oct 2012 12:54:09 +0000 (14:54 +0200)]
fix off-by-one error in key detection logic for uninitialized warnings

Prior to this patch we would not look at the 0th bucket.

11 years agoadd a TODO test for uninitialized warning hash bucket fencepost error
Yves Orton [Sat, 20 Oct 2012 11:45:02 +0000 (13:45 +0200)]
add a TODO test for uninitialized warning hash bucket fencepost error

This test assumes that a fresh hash with one key with keys from
0 to 20 will put a key in every bucket in the hash. Had we better
hash introspection rules we could write this differently and more
correctly. Nevertheless this shows the off-by-one error in key
detection used by the uninitialized warnings logic on my box.

Next patch will untodo the test and fix the bug.

11 years agoNote CPAN upgrade in perldelta.
Craig A. Berry [Fri, 19 Oct 2012 20:44:45 +0000 (15:44 -0500)]
Note CPAN upgrade in perldelta.

11 years agoUdate CPAN to CPAN version 1.99_51
Craig A. Berry [Fri, 19 Oct 2012 20:09:16 +0000 (15:09 -0500)]
Udate CPAN to CPAN version 1.99_51

  * release 1.99_51

  * RT #79969: fix incompatibilities with VMS (Craig Berry)

  * bugfix: distroprefs of type pl/args were dropped for 'perl Build.PL'

  * RT #73742: watch build_dirs and react calmly when one has gone lost

11 years agoregexec.c: regrepeat() change default: handling
Karl Williamson [Fri, 19 Oct 2012 17:57:16 +0000 (11:57 -0600)]
regexec.c: regrepeat() change default: handling

The core of this function is a large switch() statement.  Prior to this
commit, the default: case of it assumed that this meant that the
node-type was a zero-length node.  It is safer to explicitly mention
all the cases you expect to handle, and have the default fail so that
you know sooner that you forgot to handle a situation.  That is how all
other switch statements in this file are set up, and now this one is
too.

I added cases for all the node types in regcomp.c that are SIMPLE, and
hence could conceivably be handled by regrepeat(), and changed the
default: case to croak.

I considered doing an #ifdef DEBUGGING around this, but no other
switches() in the file do so, so I followed that paradigm.

11 years agoregex: Make \R simple again.
Karl Williamson [Fri, 19 Oct 2012 17:40:24 +0000 (11:40 -0600)]
regex: Make \R simple again.

Commit 565fc1bb88638c2490cdab7a1055007f6b2d577c was based on my
misunderstanding of what regrepeat() operates on.  It is designed to
operate on nodes that are quantifiable without having to be
parenthesized.  So, in 'a?', the node generated for 'a' is quantifiable
as-is, but if you want to quantify 'ab', you have to parenthesize them,
like '(?:ab)?'

\R is such a node, since you can say things like '\R+'.  There was
indeed a bug, and that commit fixed it, but suboptimally.

This patch essentially reverts the commit mentioned above, and solves
the problem in a better way; it adds comments so that future
maintainters will be less likely to be led astray than I was.

It also adds a 'SIMPLE' flag for an expression that in my previous
misunderstanding didn't think was simple.  (It's enclosed in
parentheses, and hence can serve as an operand to a quantifier.)

11 years agoBump the version to 5.17.6
Florian Ragwitz [Fri, 19 Oct 2012 18:19:45 +0000 (15:19 -0300)]
Bump the version to 5.17.6

11 years agoregexec.c: Fix bugs in regrepeat()
Karl Williamson [Fri, 19 Oct 2012 17:08:35 +0000 (11:08 -0600)]
regexec.c: Fix bugs in regrepeat()

I realized that commit 613a425dda0dc9e3f838151a5d796c902cfd922e
introduced some bugs into regrepeat().  In looking over the code more
closely, I realized that there were longstanding problems there of a
similar nature.  However, I was unable, for the most part, to come up
with tests that showed up these bugs, and that may explain why there
haven't been field reports for them.  The situations that lead to
problems are typically caught before regrepeat() gets executed.

The problem was that the situation in this function is different
depending on whether the target string is encoded in UTF-8 or not, and
not all of the cases in the switch statement followed that.  I have now
changed things, so that for both the UTF-8 and non-UTF-8 cases, the
switch is entered with things set up so that there is no extra set-up
needed for the most common situation; and comments now explain things.

11 years agoperlre: grammar, typo
Karl Williamson [Fri, 19 Oct 2012 04:04:41 +0000 (22:04 -0600)]
perlre: grammar, typo

11 years agoAdd a new perldelta
Florian Ragwitz [Fri, 19 Oct 2012 17:09:40 +0000 (14:09 -0300)]
Add a new perldelta

11 years agoAdd the 5.17.5 epigraph
Florian Ragwitz [Fri, 19 Oct 2012 16:36:41 +0000 (13:36 -0300)]
Add the 5.17.5 epigraph

11 years agoAdd 5.17.5 to perlhist
Florian Ragwitz [Fri, 19 Oct 2012 15:50:32 +0000 (12:50 -0300)]
Add 5.17.5 to perlhist

11 years agoUpdate Module::CoreList for 5.17.5
Florian Ragwitz [Fri, 19 Oct 2012 15:24:54 +0000 (12:24 -0300)]
Update Module::CoreList for 5.17.5

11 years agoFinalise perldelta
Florian Ragwitz [Fri, 19 Oct 2012 15:04:29 +0000 (12:04 -0300)]
Finalise perldelta

11 years agoCorrect a version number in perl5180delta
Florian Ragwitz [Fri, 19 Oct 2012 14:16:19 +0000 (11:16 -0300)]
Correct a version number in perl5180delta

11 years agoPerldelta up to 1443c94
Florian Ragwitz [Fri, 19 Oct 2012 14:16:07 +0000 (11:16 -0300)]
Perldelta up to 1443c94

11 years ago5.14.3 has been released
Florian Ragwitz [Tue, 16 Oct 2012 20:16:04 +0000 (17:16 -0300)]
5.14.3 has been released

11 years agoregmatch(): fix out bounds array access
David Mitchell [Fri, 19 Oct 2012 09:14:56 +0000 (10:14 +0100)]
regmatch(): fix out bounds array access

The code for EXACTF and similar tests that

    UCHARAT(s) != fold_array[nextchr]

but doesn't check first that nextchr != NEXTCHR_EOS (-10), so it can
access the byte 10 bytes before the start of one of the PL_fold_latin1 or
similar arrays. Although undesirable, it's harmless, as the worst it can
achieve is a false positive match of the first char of the EXACTF string,
which will then still fail on a full compare of the string.

11 years agoregmatch(): add asserts for legal values of nextchr
David Mitchell [Thu, 18 Oct 2012 18:54:20 +0000 (19:54 +0100)]
regmatch(): add asserts for legal values of nextchr

nextchr should always hold the next *byte* of the string, or the
special value NEXTCHR_EOS, so assert this. And when we're moving to the
next char, nextchr shouldn't already be NEXTCHR_EOS.

11 years agoregcomp.c: Use unlikely initialization value; not 0
Karl Williamson [Thu, 18 Oct 2012 16:27:38 +0000 (10:27 -0600)]
regcomp.c: Use unlikely initialization value; not 0

Commit b4295830fe1ff58bc83d963006afeb9a2e4fb2d0 added initialization to
an uninitialized variable.  I meant to change it to a less likely value,
but didn't manage to get the change in, contrary to what its commit
message says.

11 years agoPATCH: [perl #115342] Properly initialize S_regclass value (again)
rurban@cpanel.net [Thu, 18 Oct 2012 14:18:52 +0000 (07:18 -0700)]
PATCH: [perl #115342] Properly initialize S_regclass value (again)

Prevent save_value to carry along uninitialized garbage.
Regression introduced with 9d53c457 Thu Oct 11 21:49:31 2012

Committer changed 0's to OOB_UNICODE.

11 years agoutfebcdic.h: white space only
Karl Williamson [Thu, 18 Oct 2012 03:24:54 +0000 (21:24 -0600)]
utfebcdic.h: white space only

11 years agoadd PERL_CALLCONV_NO_RET to perlhost.h's PerlProcExit and PerlProc_Exit
Daniel Dragan [Wed, 10 Oct 2012 03:17:47 +0000 (23:17 -0400)]
add PERL_CALLCONV_NO_RET to perlhost.h's PerlProcExit and PerlProc_Exit

This gives noreturn to the 2 functions on Visual C Perl.

11 years agoRemove unnecessary overrides in gnukfreebsd and gnuknetbsd hints.
Niko Tyni [Wed, 17 Oct 2012 16:56:43 +0000 (12:56 -0400)]
Remove unnecessary overrides in gnukfreebsd and gnuknetbsd hints.

hints/gnukfreebsd.sh and hints/gnuknetbsd.sh unconditionally
override Configure's values for ccdlflags and lddlflags, even though
the default Configure guesses should be correct for those systems.
Configure was altered in commit fb2e1bc0638d5a5d7ac552a79a71a996a5d604cc
(Perforce change 23909) to get the correct values, but later commit
46c947e8b9def6de34ac831834a3c290ab266515 (Perforce change 24017) included
these now-outdated hints file changes as part of importing a larger set
of patches from Debian.

This patch removes the unnecessary overrides.  Thanks to Niko Tyni for
digging up the history and supplying the hints/gnukfreebsd.sh patch.

11 years agoavoid calling memset with a negative count
Andy Dougherty [Thu, 27 Sep 2012 13:52:18 +0000 (09:52 -0400)]
avoid calling memset with a negative count

Poorly written perl code that allows an attacker to specify the count to
perl's 'x' string repeat operator can already cause a memory exhaustion
denial-of-service attack. A flaw in versions of perl before 5.15.5 can
escalate that into a heap buffer overrun; coupled with versions of glibc
before 2.16, it possibly allows the execution of arbitrary code.

The flaw addressed to this commit has been assigned identifier
CVE-2012-5195.

11 years agowin32_freeenvironmentstrings: convert nonpublic exported function to macro
Daniel Dragan [Sun, 14 Oct 2012 19:30:01 +0000 (15:30 -0400)]
win32_freeenvironmentstrings: convert nonpublic exported function to macro

win32_freeenvironmentstrings was added in commit 4f46e52b008. It is not
documented as public api but is exported. Since it is nothing more than a
renaming of win32_free, replace it with a macro to win32_free. This saves
an entry in the export table, and the string name of the export from
perl517.dll. Also see
http://www.nntp.perl.org/group/perl.perl5.porters/2012/09/msg192954.html

11 years agoperldelta for #115260
Father Chrysostomos [Wed, 17 Oct 2012 03:22:26 +0000 (20:22 -0700)]
perldelta for #115260

11 years agoUsed pad name lists for pad ids
Father Chrysostomos [Wed, 17 Oct 2012 01:04:28 +0000 (18:04 -0700)]
Used pad name lists for pad ids

I added pad IDs so that a pad could record which pad it closes over,
to avoid problems with closures closing over the wrong pad, resulting
in crashes or bizarre copies.  These pad IDs were shared between
clones of the same pad.

In commit 9ef8d56, for efficiency I made clones of the same closure
share the same pad name list.

It has just occurred to be that each padlist containing the same pad
name list also has the same pad ID, so we can just use the pad name
list itself as the ID.

This makes padlists 32 bits smaller and eliminates PL_pad_generation
from the interpreter struct.

11 years agoregcomp.c: Silence compiler warning
Karl Williamson [Wed, 17 Oct 2012 03:20:47 +0000 (21:20 -0600)]
regcomp.c: Silence compiler warning

I didn't notice that I had introduced this warning until now.

11 years agoregex: \R can match either 1 or 2 chars
Karl Williamson [Tue, 16 Oct 2012 18:09:04 +0000 (12:09 -0600)]
regex: \R can match either 1 or 2 chars

Therefore it is not "simple", and should not be compiled as such,
causing things like the test added herein to fail.

11 years agoregcomp.c: Pass NULL instead of &dummy to function
Karl Williamson [Tue, 16 Oct 2012 17:12:22 +0000 (11:12 -0600)]
regcomp.c: Pass NULL instead of &dummy to function

This saves the function from setting a throw-away value

11 years agoregcomp.c, regexec.c: Comments only; no code changes
Karl Williamson [Tue, 16 Oct 2012 17:11:11 +0000 (11:11 -0600)]
regcomp.c, regexec.c: Comments only; no code changes

11 years agoregexec.c: White-space only; no code changes
Karl Williamson [Tue, 16 Oct 2012 17:09:52 +0000 (11:09 -0600)]
regexec.c: White-space only; no code changes

This indents a newly-formed block correctly

11 years agoregexec.c: Tighten loops in regrepeat()
Karl Williamson [Tue, 16 Oct 2012 16:56:28 +0000 (10:56 -0600)]
regexec.c: Tighten loops in regrepeat()

regrepeat() is used to match some simple thing repeatedly in a row.  In
the case of EXACTFish nodes, it will repeat a single character (and its
fold).  Prior to this commit, it was using the full generality of
foldEQ_utf8() whenever the target was encoded in UTF-8.  This full
generality requires quite a bit of processing.  However, most
Unicode folds are of the simple variety containing just a character and
its upper- or lower-cased equivalent, and so the full generality of
foldEQ_utf8() is needed only comparatively infrequently.

This commit takes advantage of the newly added and enhanced
S_setup_EXACTISH_ST_c1_c2() to look at the character being repeated and
decide what level of generality is needed.  regrepeat() then uses a loop
that is only as complicated as needed.

This also adds some asserts that the nodes contain exactly 1 character

11 years agoregexec: Do less work on quantified UTF-8
Karl Williamson [Tue, 16 Oct 2012 16:17:01 +0000 (10:17 -0600)]
regexec: Do less work on quantified UTF-8

Consider the regexes /A*B/ and /A*?B/ where A and B are arbitrary,
except that B begins with an EXACTish node.  Prior to this patch, as a
shortcut, the loop for accumulating A* would look for the first character
of B to help it decide if B is a possiblity for the next thing.  It did
not test for all of B unless testing showed that the next thing could be
the beginning of B.  If the target string was UTF-8, it converted each
new sequence of bytes to the code point they represented, and then did
the comparision.  This is a relative expensive process.

This commit avoids that conversion by just doing a memEQ at the current
input position.  To do this, it revamps S_setup_EXACTISH_ST_c1_c2() to
output the UTF-8 sequences to compare against.  The function also has
been tightened up so that there are fewer false positives.

11 years agoutf8.h: Add guard against recursive #include
Karl Williamson [Tue, 16 Oct 2012 15:58:24 +0000 (09:58 -0600)]
utf8.h: Add guard against recursive #include

A future commit will #include this from another header

11 years agoregen/regcharclass.pl: Change name of generated macro
Karl Williamson [Tue, 16 Oct 2012 16:45:44 +0000 (10:45 -0600)]
regen/regcharclass.pl: Change name of generated macro

This changes the macro isMULTI_CHAR_FOLD() (non-utf8 version) from just
generating ascii-range code points to generating the full Latin1 range.
However there are no such non-ASCII values, so the macro expansion is
unchanged.  By changing the name, it becomes clearer in future commits
that we aren't excluding things that we should be considering.

11 years agoregexec.c: Change variable name
Karl Williamson [Tue, 9 Oct 2012 19:34:08 +0000 (13:34 -0600)]
regexec.c: Change variable name

This actually is a pointer to the pattern string, not to a byte.

11 years agoregexp.h: Update comments
Karl Williamson [Tue, 9 Oct 2012 19:32:12 +0000 (13:32 -0600)]
regexp.h: Update comments

These comments should have been changed in commit
c74f6de970ef0f0eb8ba43b1840fde0cf5a45497, but were mistakenly omitted.

11 years ago[perl #115260] Stop length($obj) from returning undef
Father Chrysostomos [Tue, 16 Oct 2012 23:07:19 +0000 (16:07 -0700)]
[perl #115260] Stop length($obj) from returning undef

When commit 9f621bb00 made length(undef) return undef, it also made it
return undef for objects with string overloading that returns undef.

But stringifying as undef is a contradiction in terms, and this makes
length inconsistent with defined, which returns true for such objects.

Changing this allows is to simplify pp_length, as we can now call
sv_len_utf8 on the argument unconditionally (except under the bytes
pragma).  sv_len_utf8 is now careful not to record caches on magical
or overloaded scalars (any non-PV, in fact).

Note that sv_len is now just a wrapper around SvPV_const, so we use
SvPV_const_nomg, as there is no equivalent sv_len_nomg.

11 years ago[perl #96230] Stop s/$qr// from reusing last pattern
Father Chrysostomos [Tue, 16 Oct 2012 21:36:43 +0000 (14:36 -0700)]
[perl #96230] Stop s/$qr// from reusing last pattern

qr// should not be using the last-successful pattern, because it is
"(?^:)", not the empty pattern.  A stringified qr// does not use the
last-successful pattern.

This was fixed for m/$qr/ (and =~ qr//) in commit 7e31363783, but
s/$qr// was left out.

11 years agoperlδ up to the present
Father Chrysostomos [Tue, 16 Oct 2012 21:09:14 +0000 (14:09 -0700)]
perlδ up to the present

11 years agocpan: Upgrade AutoLoader to 5.73
Steffen Mueller [Tue, 16 Oct 2012 15:27:47 +0000 (17:27 +0200)]
cpan: Upgrade AutoLoader to 5.73

Just syncing to CPAN release.

11 years agoUpdate HTTP-Tiny to CPAN version 0.024
Chris 'BinGOs' Williams [Tue, 16 Oct 2012 11:55:44 +0000 (12:55 +0100)]
Update HTTP-Tiny to CPAN version 0.024

  [DELTA]

  0.024     2012-10-09 20:44:53 America/New_York

    [ADDED]

    - SSL connections now auto-retry I/O after SSL renegotiation [Alan
      Gardner]

    [FIXED]

    - User-specified CA bundles take precedence over Mozilla::CA [Alan
      Gardner]

    [PREREQS]

    - SSL support now requires Net::SSLeay 1.49 or greater to support
      auto-retry [Mike Doherty]

    - Downgraded IO::Socket::SSL and related prereqs to 'suggests' again

  0.023     2012-09-19 09:55:46 America/New_York

    [PREREQS]

    - IO::Socket::SSL and related prereqs changed to 'required' for dev
      release to get better failure diagnostics from CPAN Testers

    [TESTING]

    - Skip live SSL testing unless IO::Socket::SSL 1.56+ installed

11 years agoSync Module-CoreList in Porting/Maintainers.pl with CPAN
Chris 'BinGOs' Williams [Tue, 16 Oct 2012 11:50:46 +0000 (12:50 +0100)]
Sync Module-CoreList in Porting/Maintainers.pl with CPAN

11 years agoperlδ up to 40f316a72b
Father Chrysostomos [Tue, 16 Oct 2012 06:56:33 +0000 (23:56 -0700)]
perlδ up to 40f316a72b

11 years agoMake PerlIO::encoding handle cows
Father Chrysostomos [Tue, 16 Oct 2012 06:06:31 +0000 (23:06 -0700)]
Make PerlIO::encoding handle cows

Commits 667763bdbf and e9a8753af fixed bugs involving buffer realloca-
tions during encode and decode.  But what was not taken into account
was that the COW flags could still be left on even when buffer real-
ocations were accounted for.  This could result in SvPV_set and
SvLEN_set(sv,0) being called on an SV with the COW flags still on,
so SvPVX would be treated as a key inside a shared_he, resulting in
assertion failures.

11 years agoPrune some dead code in pp.c:pp_undef
Father Chrysostomos [Tue, 16 Oct 2012 05:53:30 +0000 (22:53 -0700)]
Prune some dead code in pp.c:pp_undef

Since commit 6fc9266916, the if (SvFAKE) check under the SVt_PVGV case
in pp_undef has been redundant.  And PVBMs are no longer GVs.

11 years agoMake PerlIO::encoding even more resilient to moving buffers
Father Chrysostomos [Mon, 15 Oct 2012 06:09:56 +0000 (23:09 -0700)]
Make PerlIO::encoding even more resilient to moving buffers

Commit 667763bdbf was not good enough.

If the buffer passed to an encode method is reallocated, it may be
smaller than the size (bufsiz) stored inside the encoding layer.  So
we need to extend the buffer in that case and make sure the buffer
pointer is not pointing to freed memory.

The test as modified by this commit causes malloc errors on stderr
when I try it without the encoding.xs changes.

11 years agoBump $Win32CORE::VERSION following commit 35f601d964
Steve Hay [Mon, 15 Oct 2012 07:35:59 +0000 (08:35 +0100)]
Bump $Win32CORE::VERSION following commit 35f601d964

11 years agohave Win32CORE use ALIAS/XSANY
Daniel Dragan [Tue, 9 Oct 2012 01:00:06 +0000 (21:00 -0400)]
have Win32CORE use ALIAS/XSANY

Using XSANY in addition to a struct of strings, saved 650 bytes (.rdata
and .text combined, 32bit/MS VC2K3/O1) from the previous implementation of
Win32CORE. Instead of encoding pointers or relative pointer sized offsets
to string literals, use unsigned chars. Instead of creating new XSUB C
function stubs, one per forwarded sub, use the ALIAS/XSANY feature and
have only 1 XSUB which has many names. If a length aware version of newXS
is ever added to perl, the sub names's lengths already are available. See
also commit eff5b9d539e for something similar to this commit.

11 years agoregcomp.c: Don't set /i in start class unless /l
Karl Williamson [Sun, 14 Oct 2012 00:17:11 +0000 (18:17 -0600)]
regcomp.c: Don't set /i in start class unless /l

There is a deficiency in the optimizer in which it doesn't get rid of
flags that it should.  One of these is if it should match /i or not.
Currently it always (perhaps not quite, I don't know) assumes that it
should match under /i, yielding false positives and slowing things down.
But a recent commit changed the flag that tells it to do this, so that it
only gets set if /l is also specified.  There is already existing code to
work around the optimizer deficiency for /l.  This commit just moves the
/i flag handling to that existing code, so it won't get invoked unless
/l is specified.

11 years agoregexp.t: Add 'no warnings "utf8";
Karl Williamson [Sat, 13 Oct 2012 16:00:18 +0000 (10:00 -0600)]
regexp.t: Add 'no warnings "utf8";

This .t works fine unless there are failures that it tries to output,
and the handle hasn't been opened using utf8.  Because we aren't sure if
that operation works, just turn off warnings.

11 years agoutf8.h: Correct some values for EBCDIC
Karl Williamson [Sat, 13 Oct 2012 15:52:42 +0000 (09:52 -0600)]
utf8.h: Correct some values for EBCDIC

It occurred to me that EBCDIC has different maximums for the number of
bytes a character can occupy.  This moves the definition in utf8.h to
within an #ifndef EBCDIC, and adds the correct values to utfebcdic.h

11 years agoregex: White-space, comment only; no code changes
Karl Williamson [Sat, 13 Oct 2012 15:20:11 +0000 (09:20 -0600)]
regex: White-space, comment only; no code changes

This outdents code that just had its containing block removed, and
reflows its comments to fill 79 columns; and does some other white space
adjustments, plus a typo in a comment.

11 years agoregex: Rename macro to reflect its narrowed use
Karl Williamson [Sat, 13 Oct 2012 15:15:37 +0000 (09:15 -0600)]
regex: Rename macro to reflect its narrowed use

This macro is now only used under locale; its other use has now been
removed.  Change the name to reflect its only use.

11 years agoregex: Splice out no longer used array element
Karl Williamson [Sat, 13 Oct 2012 15:07:05 +0000 (09:07 -0600)]
regex: Splice out no longer used array element

A recent commit removed all uses of an array element in the middle of an
array.  This moves up the elements that followed it.

11 years agoregex: Remove old code that tried to handle multi-char folds
Karl Williamson [Sat, 13 Oct 2012 14:49:26 +0000 (08:49 -0600)]
regex: Remove old code that tried to handle multi-char folds

A recent commit has changed the algorithm used to handle multi-character
folding in bracketed character classes.  The old code is no longer
needed.

11 years agoregcomp.c: Fix-up indentaion; no code changes
Karl Williamson [Fri, 12 Oct 2012 17:42:38 +0000 (11:42 -0600)]
regcomp.c: Fix-up indentaion; no code changes

Indent a newly-formed block

11 years agoPATCH: [perl #89774] multi-char fold + its fold in char class
Karl Williamson [Fri, 12 Oct 2012 03:49:31 +0000 (21:49 -0600)]
PATCH: [perl #89774] multi-char fold + its fold in char class

The design for handling characters that fold to multiple characters when
the former are encountered in a bracketed character class is defective.
The ticket reads, "If a bracketed character class includes a character
that has a multi-char fold, and it also includes the first character of
that fold, the multi-char fold will never be matched; just the first
character of the fold.".   Thus, in the class /[\0-\xff]/i, \xDF will
never be matched, because its fold is 'ss', the first character of
which, 's', is also in the class.

The reason the design is defective is that it doesn't allow for
backtracking and trying the other options.

This commit solves this by effectively rewriting the above to be
/ (?: \xdf | [\0-\xde\xe0-\xff] ) /xi.  And so the backtracking gets
handled automatcially by the regex engine.

11 years agoregen/mk_invlists.pl: Make list for multi-fold chars
Karl Williamson [Fri, 12 Oct 2012 17:24:34 +0000 (11:24 -0600)]
regen/mk_invlists.pl: Make list for multi-fold chars

This causes charclass_invlists.h to have a new list of all the
characters whose fold is a sequence of more than one character.

11 years agomktables: Add table for chars with multi-char fold
Karl Williamson [Fri, 12 Oct 2012 15:10:10 +0000 (09:10 -0600)]
mktables: Add table for chars with multi-char fold

This will be used in a later commit

11 years agoregcomp.c: Rename a macro, fix-up comments
Karl Williamson [Sat, 13 Oct 2012 14:31:29 +0000 (08:31 -0600)]
regcomp.c: Rename a macro, fix-up comments

This very recently introduced macro's name could be clearer, and it can
be used in another place, and the comment concerning that is slightly
inaccurate.

11 years agoLink to 5.14.3 announcement
Dominic Hargreaves [Sat, 13 Oct 2012 10:06:48 +0000 (11:06 +0100)]
Link to 5.14.3 announcement

11 years agoHandle cow $_ in @INC filter
Father Chrysostomos [Sat, 13 Oct 2012 05:29:04 +0000 (22:29 -0700)]
Handle cow $_ in @INC filter

Setting $_ to a copy-on-write scalar in an @INC filter causes the
parser to modify every other scalar sharing the same string buffer.
It needs to be forced to a regular scalar before the parser sees it.

11 years agoAllow COW copies in aassign
Father Chrysostomos [Sat, 13 Oct 2012 04:59:47 +0000 (21:59 -0700)]
Allow COW copies in aassign

When the ‘no common vars’ optimisation is not active, list assignment
does not allow COW copies (unless assigning to an empty hash or
array).  It has been this way since 61e5f455dc.  The recent addition
of sv_mortalcopy_flags gives us an easy way to fix this.

A certain test in tr.t was marked TODO if not given a COW.  This test
used to pass before 61e5f455dc, but after than becaming a failing TODO
test.  It makes sense to test that we do have a COW instead of having
a conditional TODO.

11 years agoAdd references to perl5143delta
Dominic Hargreaves [Fri, 12 Oct 2012 22:42:07 +0000 (23:42 +0100)]
Add references to perl5143delta

11 years agoAdd the 5.14.3 perldelta
Dominic Hargreaves [Fri, 12 Oct 2012 22:39:22 +0000 (23:39 +0100)]
Add the 5.14.3 perldelta

11 years agoAdd 5.14.3 to perlhist
Dominic Hargreaves [Thu, 11 Oct 2012 18:56:22 +0000 (19:56 +0100)]
Add 5.14.3 to perlhist

11 years agoadd 5.14.3 epigraph
Dominic Hargreaves [Fri, 12 Oct 2012 21:57:16 +0000 (22:57 +0100)]
add 5.14.3 epigraph

11 years agoUpdate Module-CoreList Changes file
Chris 'BinGOs' Williams [Fri, 12 Oct 2012 21:24:16 +0000 (22:24 +0100)]
Update Module-CoreList Changes file

11 years agoAdd v5.14.3 data to Module::CoreList and bump to 2.74
Chris 'BinGOs' Williams [Fri, 12 Oct 2012 09:26:38 +0000 (10:26 +0100)]
Add v5.14.3 data to Module::CoreList and bump to 2.74

11 years agotoke.c: Rewrite bogus yylex comment
Father Chrysostomos [Fri, 12 Oct 2012 07:08:14 +0000 (00:08 -0700)]
toke.c: Rewrite bogus yylex comment

This comment has been wrong since it was first added.  What it des-
cribed was then the code at the beginning of yylex, before the main
tokenizing switch.

Since then, two parts of what it described have moved elsewhere; the
pending identifier code to S_pending_ident, and the sort $a<=>$b check
to op.c:S_simplify_sort.

11 years agoperlreapi.pod: Consistent spaces after dots
Father Chrysostomos [Fri, 12 Oct 2012 06:40:09 +0000 (23:40 -0700)]
perlreapi.pod: Consistent spaces after dots

11 years agoperlreapi.pod: Document RXf_MODIFIES_VARS
Father Chrysostomos [Fri, 12 Oct 2012 06:31:00 +0000 (23:31 -0700)]
perlreapi.pod: Document RXf_MODIFIES_VARS

11 years agoperlreapi.pod: Update RXf_SKIPWHITE section
Father Chrysostomos [Fri, 12 Oct 2012 06:27:37 +0000 (23:27 -0700)]
perlreapi.pod: Update RXf_SKIPWHITE section

11 years agoperlreapi.pod: Update RXf_SPLIT section
Father Chrysostomos [Fri, 12 Oct 2012 06:26:21 +0000 (23:26 -0700)]
perlreapi.pod: Update RXf_SPLIT section

11 years agoDisable const repl optimisation for empty pattern
Father Chrysostomos [Fri, 12 Oct 2012 05:51:44 +0000 (22:51 -0700)]
Disable const repl optimisation for empty pattern

s//$a/ cannot assume that the $a expression is going to return the
same value at each iteration, because the last-used pattern may con-
tain code blocks that clobber *a.

11 years agodefins.t: Suppress uninit warning
Father Chrysostomos [Fri, 12 Oct 2012 03:26:23 +0000 (20:26 -0700)]
defins.t: Suppress uninit warning

and make the no-warnings test pass.

11 years agoMove tests from t/op/while_readdir.t to t/op/defins.t
Brad Gilbert [Tue, 9 Oct 2012 19:24:38 +0000 (14:24 -0500)]
Move tests from t/op/while_readdir.t to t/op/defins.t

It turns out that some of what t/op/while_readdir.t was testing
was also tested by t/op/defins.t

11 years agoUse const repl optimisation with s///e where possible
Father Chrysostomos [Fri, 12 Oct 2012 03:22:08 +0000 (20:22 -0700)]
Use const repl optimisation with s///e where possible

In those cases where s///e contains a single variable or a sequence
that is folded to a const op, we can do away with substcont.

PMf_EVAL means that there was an /e.  But we don’t actually need to
check that; instead we can just examine the op tree, which we have to
do anyway.

The op tree that s//$x/e and s//"constant"/e compile down to have a
null (a do-block) containing a scope op (block with a single state-
ment, as opposed to op_leave which represents multiple statements)
containing a null followed by the constant or variable.

11 years agoperl5180delta: B::Generate is fixed
Father Chrysostomos [Fri, 12 Oct 2012 02:55:20 +0000 (19:55 -0700)]
perl5180delta: B::Generate is fixed

11 years ago[perl #49190] Don’t prematurely optimise s/foo/bar$baz/
Father Chrysostomos [Thu, 11 Oct 2012 21:38:31 +0000 (14:38 -0700)]
[perl #49190] Don’t prematurely optimise s/foo/bar$baz/

$baz could be aliased to a package variable, so we do need to recon-
catenate for every iteration of s///g.  For s/// without /g, only one
more op will be executed, so the speed difference is negligible.

The only cases we can optimise in terms of skipping the evaluation of
the ops on the rhs (by eliminating the substconst op) are s//constant/
and s//$single_variable/.  Anything more complicated causes bugs.

A recent commit made s/foo/$bar/g re-stringify $bar for each iteration
(though without having to reevaluate the ops that return $bar).  So we
no longer have to special-case match vars at compile time.

This means that s/foo/bar$baz/g will be slower (and less buggy), but
s/foo/$1/g will be faster.

This also caused an existing taint but in pp_subst to surface.  If
get-magic turns off taint on a replacement string, it should not be
considered tainted.  So the taint check on the replacement should come
*after* the stringification.  This applies to the constant replacement
optimisation.  pp_substcont was already doing this correctly.