This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
11 years agoext/XS-APItest/t/handy.t: Work better on platforms sans proper locales
Karl Williamson [Sun, 23 Dec 2012 20:44:19 +0000 (13:44 -0700)]
ext/XS-APItest/t/handy.t: Work better on platforms sans proper locales

This was skipping a bunch of tests that should have been done when the
platform does not have properly working locales.

11 years agoProper IEEE overflow semantics for VMS.
Craig A. Berry [Sun, 23 Dec 2012 19:42:47 +0000 (13:42 -0600)]
Proper IEEE overflow semantics for VMS.

Way back in 67597c89125e7e14 we misspelled _IEEE_FP as __IEEE_FP,
with a spurious leading underscore.  Which I then copied and
pasted into pp_pack.c in baf3cf9c09c529.  This means that on
Alpha and Itanium systems with the default selection of IEEE
floating point, we've actually (for the last decade!) been
using a workaround intended for VAX or Alpha and Itanium builds
that have explicitly selected VAX-compatible floating point
formats.  Oh well.

11 years agosvleak.t: Add a test; make another more robust
Karl Williamson [Sat, 22 Dec 2012 19:45:00 +0000 (12:45 -0700)]
svleak.t: Add a test; make another more robust

The code that these tests are for has recently changed to perhaps
allocate a scalar which is not freed until global destruction.
Therefore, run the loop more times and allow a tolerance of one scalar.

11 years agoDeprecate calling isFOO_utf8() with malformed
Karl Williamson [Sun, 23 Dec 2012 17:03:16 +0000 (10:03 -0700)]
Deprecate calling isFOO_utf8() with malformed

handy.h has character classification macros to determine if a UTF-8
encoded character is of a given type FOO, such as isALPHA_utf8(), etc.
Code that calls these should have first made sure that the parameter is
legal UTF-8.  Prior to this patch, false was silently returned for all
illegal UTF-8.  Now, in most instances, a deprecation warning is raised.
This is to catch bugs, and prepare for eventual elimination of this
check, which fails to catch read-off-end-of-buffer malformations anyway.
(One idea would be to leave the check in for DEBUGGING builds.)

The cases where no deprecation warning is raised as a result of this
commit is for the classes where the character does not have to be
converted to a code point for its inclusion to be determined.  For
example, if malformed UTF-8 is checked to see if it is ASCII, we only
need to check that it is one of the 128 ASCII characters.  If it isn't,
we don't bother to see if it is malformed or not.  There are other
cases, as well, such as with isSPACE(), where we check if the UTF-8 is
one of a very finite set, without checking for malformedness.

This commit causes a number of apparent bugs to be shown by the Perl
test suite.  These do not cause actual failures.

11 years agoAdd Augustina Blair to AUTHORS
Karl Williamson [Sun, 23 Dec 2012 16:17:27 +0000 (09:17 -0700)]
Add Augustina Blair to AUTHORS

11 years agoRemoved p5p-faq reference from perlhack.pod.
Augustina Blair [Mon, 17 Dec 2012 18:47:52 +0000 (13:47 -0500)]
Removed p5p-faq reference from perlhack.pod.

Original document linked to has been removed because it was out of date and
redundant.

11 years agoregcomp.pl: Calculate col widths for perldebguts
Father Chrysostomos [Sun, 23 Dec 2012 07:26:37 +0000 (23:26 -0800)]
regcomp.pl: Calculate col widths for perldebguts

I put this in originally, but somehow undid it by mistake before
committing 65aa4ca74a9c.

11 years agoRegenerate the regnode table in perldebguts.pod automatically
Father Chrysostomos [Sun, 23 Dec 2012 07:07:31 +0000 (23:07 -0800)]
Regenerate the regnode table in perldebguts.pod automatically

11 years agoregcomp.c: Change some instances to SvREFCNT_dec_NN
Karl Williamson [Sun, 23 Dec 2012 03:45:39 +0000 (20:45 -0700)]
regcomp.c: Change some instances to SvREFCNT_dec_NN

I went through regcomp.c and for the areas I am familiar with, plus
those where it was trivially determinable, converted to SvREFCNT_dec_NN
where possible.  I am not saying there aren't more ones that could be
converted.

11 years agoIncrease $diagnostics::VERSION to 1.31
Father Chrysostomos [Sun, 23 Dec 2012 01:47:27 +0000 (17:47 -0800)]
Increase $diagnostics::VERSION to 1.31

11 years agoRT-89642 - Don't treat ,; as special end-of-line characters.
Matthew Horsfall (alh) [Sun, 16 Dec 2012 23:02:43 +0000 (18:02 -0500)]
RT-89642 - Don't treat ,; as special end-of-line characters.

Support multi-line "=item ..." expressions per the POD spec.

This also allows warnings with white-space differences to match.

11 years agoregcomp.c: Yet another move of declaration to proper place
Karl Williamson [Sun, 23 Dec 2012 00:54:46 +0000 (17:54 -0700)]
regcomp.c: Yet another move of declaration to proper place

Commit 3fde42ccb5ca4eb8238f0fcbd2a01464a9c6193d did not get the
declarations in the proper order.  I don't understand how this got out
of order in the first place, but hopefully this will fix it up.

11 years agoFix erroneous USE_LONG_DOUBLE in configure.com.
Craig A. Berry [Sat, 22 Dec 2012 22:38:41 +0000 (16:38 -0600)]
Fix erroneous USE_LONG_DOUBLE in configure.com.

Once upon a time there was a "use64bit" option [1] that only later
became separated into use64bitint, uselongdouble, and use64bitall,
but we didn't properly separate out everything.  So if you chose
64-bit integers but not long doubles, you would get the macro
USE_LONG_DOUBLE defined but without other supporting defines and
with incompatible branches followed in various parts of the #ifdef
jungle.  So separate them out.  Thanks to Thomas Pfau for trying
what's apparently a rare configuration.

[1] See fafa4fee6354847ae7fda.

11 years agoFix d_nv_preserves_uv on VMS with 64-bit int but no long double.
Craig A. Berry [Sat, 22 Dec 2012 22:32:02 +0000 (16:32 -0600)]
Fix d_nv_preserves_uv on VMS with 64-bit int but no long double.

There was a typo in a5bd55ee8902ea3fcb that left a spurious double
quote in config.h and caused compile failures when compiling with
-Duse64bitint but not also selecting -Duselongdouble.  Problem
reported by Thomas Pfau.

11 years agoregcomp.c: Move declaration to proper place
Karl Williamson [Sat, 22 Dec 2012 20:29:24 +0000 (13:29 -0700)]
regcomp.c: Move declaration to proper place

Declarations must come before code in C89.  I fixed this earlier based
on smoke results, but somehow it got lost, and my compiler doesn't warn
for this.

11 years agoMerge character class handling revamp topic branch into blead
Karl Williamson [Sat, 22 Dec 2012 18:12:08 +0000 (11:12 -0700)]
Merge character class handling revamp topic branch into blead

This sequence of commits cuts down the amount of duplication in handling
character classes (like \w, [:graph:]).  There are three principal
components: 1) refactor a switch statement in regcomp.c to have common
code for most of the possible classes; 2) replace the 30 regops that
handle these classes by just 4 (effectively) distinct ones; 3) deprecate
the functions callable from XS that do character classification.  XS
code should instead (if they weren't already) use macros in handy.h to
accomplish this purpose.

11 years agoregcomp.c: Reorder some case: statements so can FALL THROUGH
Karl Williamson [Thu, 20 Dec 2012 17:22:26 +0000 (10:22 -0700)]
regcomp.c: Reorder some case: statements so can FALL THROUGH

11 years agoregcomp.c: White-space only; no code changes
Karl Williamson [Thu, 20 Dec 2012 17:10:34 +0000 (10:10 -0700)]
regcomp.c: White-space only; no code changes

This properly indents some lines, and adds/subtracts white space
elsewhere

11 years agoDeprecate all is_(uni|utf8)_foo function uses
Karl Williamson [Thu, 20 Dec 2012 16:39:22 +0000 (09:39 -0700)]
Deprecate all is_(uni|utf8)_foo function uses

Coders should use the macros in handy.h instead of calling these
directly.

11 years agoCreate internal _is_utf8_mark()
Karl Williamson [Thu, 20 Dec 2012 16:29:36 +0000 (09:29 -0700)]
Create internal _is_utf8_mark()

This is so we can deprecate non-core use of the existing one in a future
commit.  XS coders should be using the macros in handy.h instead of
calling such functions directly.  A future commit will deprecate all of
them, but first the core uses of this one must change so they don't
generate deprecation messages.  I will not have a chance to look for
some time, but I suspect that most uses of this function in the core
should be changed to use something else, but in the meantime, the
non-core uses can be deprecated.

11 years agoregexec.c: Combine adjacent 'ifs' with same clause
Karl Williamson [Wed, 19 Dec 2012 20:54:16 +0000 (13:54 -0700)]
regexec.c: Combine adjacent 'ifs' with same clause

These two instances of 'if (a) { b } if (c) { b }  are combined to
    if (a || c) { b }

The final instance is made into an else since the 'if' before it does a
break, so that the break is eliminated.

11 years agoregexec.c: Remove 2 unnecessary break statements
Karl Williamson [Wed, 19 Dec 2012 20:53:02 +0000 (13:53 -0700)]
regexec.c: Remove 2 unnecessary break statements

11 years agoRemove TODO for test for #114272
Karl Williamson [Wed, 19 Dec 2012 20:39:45 +0000 (13:39 -0700)]
Remove TODO for test for #114272

This is now fixed

11 years agoRemove temporary back-compat PL_ variable names
Karl Williamson [Wed, 19 Dec 2012 20:30:33 +0000 (13:30 -0700)]
Remove temporary back-compat PL_ variable names

These names are synonyms for specific array elements, and were used
temporarily until all uses of them were removed.  This commit removes
the remaining uses, and the definitions

11 years agoutf8.c: Remove two internal now unused functions.
Karl Williamson [Wed, 19 Dec 2012 20:27:08 +0000 (13:27 -0700)]
utf8.c: Remove two internal now unused functions.

These functions were used internally as helpers for matching \X in
regular expressions.  They are no longer used.

11 years agoregexec.c: Revamp the macros to load swashes
Karl Williamson [Wed, 19 Dec 2012 20:07:48 +0000 (13:07 -0700)]
regexec.c: Revamp the macros to load swashes

This changes the swash-load macros to use swash_init() and swash_fetch()
instead of calling is_utf8_xxx() functions that may only be needed for
this purpose (which will hence become eligible for removal because of
this commit).

The check that a known character matches the loaded swash is now only
done in DEBUGGING builds.  And the macro to load the DIGIT swash is
removed, as there are no remaining calls of it.

11 years agohandy.h: Improve some comments
Karl Williamson [Wed, 19 Dec 2012 19:55:47 +0000 (12:55 -0700)]
handy.h: Improve some comments

11 years agoregexec.c: Remove unused macro definitions
Karl Williamson [Wed, 19 Dec 2012 19:09:20 +0000 (12:09 -0700)]
regexec.c: Remove unused macro definitions

These are no longer used.

11 years agoregcomp.c: Reorder two if-elses
Karl Williamson [Tue, 18 Dec 2012 20:58:00 +0000 (13:58 -0700)]
regcomp.c: Reorder two if-elses

It is generally easier to understand an
    if () { few statements } else { many statements}
than the other way around.

11 years agoConsolidate some regex OPS
Karl Williamson [Tue, 18 Dec 2012 04:37:40 +0000 (21:37 -0700)]
Consolidate some regex OPS

The regular rexpression operation POSIXA works on any of the (currently)
16 posix classes (like \w and [:graph:]) under the regex modifier /a.
This commit creates similar operations for the other modifiers: POSIXL
(for /l), POSIXD (for /d), POSIXU (for /u), plus their complements.

It causes these ops to be generated instead of the ALNUM, DIGIT,
HORIZWS, SPACE, and VERTWS ops, as well as all their variants.  The net
saving is 22 regnode types.

The reason to do this is for maintenance.  As of this commit, there are
now 22 fewer node types for which code has to be maintained.  The code
for each variant was essentially the same logic, but on different
operands.  It would be easy to make a change to one copy and forget to
make the corresponding change in the others.  Indeed, this patch fixes
[perl #114272] in which one copy was out of sync with others.

This patch actually reduces the number of separate code paths to 5:
POSIXA, NPOSIXA, POSIXL, POSIXD, and POSIXU.  The complements of the
last 3 use the same code path as their non-complemented version, except
that a variable is initialized differently.  The code then XORs this
variable with its result to do the complementing or not.  Further, the
POSIXD branch now just checks if the target string being matched is
UTF-8 or not, and then jumps to either the POSIXU or POSIXA code
respectively.  So, there are effectively only 4 cases that are coded:
POSIXA, NPOSIXA, POSIXL, and POSIXU.  (POSIXA doesn't have to worry
about UTF-8, while NPOSIXA does, hence these for efficiency are coded
separately.)

Removing all this code saves memory.  The output of the Linux size
command shows that the perl executable was shrunk by 33K bytes on my
platform compiled under -O0 (.7%) and by 18K bytes (1.3%) under -O2.

The reason this patch was doable was previous work in numbering the
POSIX classes, so that they could be indexed in arrays and bit
positions.  This is a large patch; I didn't see how to break it into
smaller components.

I chose to make this code more efficient as opposed to saving even more
memory.  Thus there is a separate loop that is jumped to after we know
we have to load a swash; this just saves having to test if the swash is
loaded each time through the loop.  I avoid loading the swash until
absolutely necessary.  In places in the previous version of this code,
the swash was loaded when the input was UTF-8, even if it wasn't yet
needed (and might never be if the input didn't contain anything above
Latin1); apparently to avoid the extra test per iteration.

The Perl test suite runs slightly faster on my platform with this patch
under -O0, and the speeds are indistinguishable under -O2.  This is in
spite of these new POSIX regops being unknown to the regex optimizer
(this will be addressed in future commits), and extra machine
instructions being required for each character (the xor, and some
shifting and masking).  I expect this is a result of better caching, and
not loading swashes unless absolutely necessary.

11 years agoregexec.c: comments, white-space only
Karl Williamson [Mon, 17 Dec 2012 16:09:05 +0000 (09:09 -0700)]
regexec.c: comments, white-space only

No code changes

11 years agohandy.h: Refactor some internal macro calls
Karl Williamson [Wed, 19 Dec 2012 19:51:05 +0000 (12:51 -0700)]
handy.h: Refactor some internal macro calls

I didn't plan very well when I added these macros recently.  This
refactors them to be more logical.

11 years agoregcomp.c: Expand only call of a macro
Karl Williamson [Mon, 17 Dec 2012 03:35:30 +0000 (20:35 -0700)]
regcomp.c: Expand only call of a macro

11 years agoregcomp.c: Combine two cases in a switch()
Karl Williamson [Mon, 17 Dec 2012 03:11:30 +0000 (20:11 -0700)]
regcomp.c: Combine two cases in a switch()

Like [[:^digit]] done in a previous commit, the non-complemented
[[:digit:]] can be combined with its kin, provided we override a
variable setting for just it.

11 years agoregcomp.c: Replace macro by expansion in only place called
Karl Williamson [Mon, 17 Dec 2012 01:58:33 +0000 (18:58 -0700)]
regcomp.c: Replace macro by expansion in only place called

Previous commits have removed all but one call of this macro.  Replace
that call by its expansion.  It also adds some comments.

11 years agoregcomp.c: Collapse switch() case
Karl Williamson [Sun, 16 Dec 2012 21:29:41 +0000 (14:29 -0700)]
regcomp.c: Collapse switch() case

This combines one switch case with another, overriding a variable
setting is all that is needed to make these identical.

11 years agoregcomp.c: Expand single instance of macro
Karl Williamson [Sun, 16 Dec 2012 04:10:37 +0000 (21:10 -0700)]
regcomp.c: Expand single instance of macro

This small macro has only one call of it

11 years agoregcomp.c: Collapse cases in a switch()
Karl Williamson [Sun, 16 Dec 2012 04:03:23 +0000 (21:03 -0700)]
regcomp.c: Collapse cases in a switch()

[:upper:] and [:lower:] have the same logic as some other cases in the
switch statement, but differ in that under /i they match more than just
themselves, and this has to be accounted for.

By moving the test for /i to outside the switch(), these cases can be
collapsed.  There is a small performance penalty in having to test for
all classes if /i is active, and if so, if the class is one of these
two.

11 years agoregcomp.c: Use auto variables set to array elements
Karl Williamson [Sun, 16 Dec 2012 03:47:53 +0000 (20:47 -0700)]
regcomp.c: Use auto variables set to array elements

This permits slightly clearer reading of the code, and will be useful in
a future commit to allow further collapsing of cases int the switch()

11 years agoregcomp.c: Collapse some switch() cases
Karl Williamson [Sun, 16 Dec 2012 03:24:24 +0000 (20:24 -0700)]
regcomp.c: Collapse some switch() cases

Careful inspection of these 4 cases shows that each pair differs only in
one spot, which varies only a compile time, so a #ifdef can be used to
control that, and the cases can be collapsed.  This results in an extra
test for those platforms that don't have isblank().

11 years agoregcomp.c: Move some code to later in block
Karl Williamson [Sun, 16 Dec 2012 03:05:31 +0000 (20:05 -0700)]
regcomp.c: Move some code to later in block

These two code snippets are currently unrelated to anything else going
on in their respective blocks.  A future commit, however, will want
things like this to happen after the 'posixes' variable has been
updated.

11 years agoregcomp.c: Combine some cases in a switch()
Karl Williamson [Sun, 16 Dec 2012 02:28:20 +0000 (19:28 -0700)]
regcomp.c: Combine some cases in a switch()

These cases differ only in the operand.  The logic is identical.

11 years agoregcomp.c: Replace macro call by goto
Karl Williamson [Sat, 15 Dec 2012 18:51:24 +0000 (11:51 -0700)]
regcomp.c: Replace macro call by goto

The macros are called with identical parameters.  This avoids the extra
expansion of them.

11 years agoregcomp.c: Slight refactor of [[:blank:]]
Karl Williamson [Sat, 15 Dec 2012 18:32:48 +0000 (11:32 -0700)]
regcomp.c: Slight refactor of [[:blank:]]

The C library function isblank() is not available on every platform.  A
Configure probe determines if it exists on the current platform.  If so,
compiling it can be done just like all the similar ones.  Only if
isblank() is not present does there need to be special handling.

This commit changes the cases of a switch statement so that if isblank()
is present, there is no special handling.

11 years agoregcomp.c: Remove dead code
Karl Williamson [Sat, 15 Dec 2012 17:46:10 +0000 (10:46 -0700)]
regcomp.c: Remove dead code

The commit just prior to this one created a different way of using
compile-time values, which bypasses this one.

11 years agoregcomp.c: Use values if known at compile time
Karl Williamson [Sat, 15 Dec 2012 04:43:14 +0000 (21:43 -0700)]
regcomp.c: Use values if known at compile time

When compiling a regular expression, it is too expensive to go out and
load from disk the list of code points that match a particular Posix
character class.  Some of these classes have so few code points, that
the lists are compiled in, but others are too large for that, for
example the list of code points that match \w.  (Also, it is known at
compile time which of the 256 code points within the Latin-1 range match
any Posix character class.)

The lists for beyond Latin-1 are demand-loaded upon first need for each,
thus the loading is deferred to execution time.  This is less efficient
than doing it at compilation time, but many many programs will never need
to load them, so the deferral is a big gain.  However, once loaded, they
stay loaded (in the current and all sub threads).  It may be that at the
time a regex is being compiled that a list it needs has already been
loaded for some other reason.  Then, the data is already available for
free, and this commit changes to use it for most Posix character
classes, and their complements.  This method replaces one that was
instituted just a few commits ago (I can't refer to its commit number,
because it is subject to change before the final push to blead; but it
has the same title as this commit.)

Future commits will expand the number of classes that use the mechanism
started in this commit

11 years agoregcomp.c: Move some cases in a switch around
Karl Williamson [Fri, 14 Dec 2012 22:39:02 +0000 (15:39 -0700)]
regcomp.c: Move some cases in a switch around

This is so future commits can have a FALL THROUGH

11 years agoregcomp.c: Collapse some switch casses
Karl Williamson [Fri, 14 Dec 2012 03:30:10 +0000 (20:30 -0700)]
regcomp.c: Collapse some switch casses

Previous commits have caused these cases in this switch to be identical,
so they can be collapsed.

11 years agoUse an array for some inversion lists
Karl Williamson [Thu, 13 Dec 2012 17:39:53 +0000 (10:39 -0700)]
Use an array for some inversion lists

Previous commits have placed some inversion list pointers into arrays.
This commit extends that to another group of inversion lists

11 years agoregcomp.c: Collapse two identical cases in a switch
Karl Williamson [Thu, 13 Dec 2012 16:09:17 +0000 (09:09 -0700)]
regcomp.c: Collapse two identical cases in a switch

11 years agoregcomp.c: Use calculated value instead of hard-coded
Karl Williamson [Thu, 13 Dec 2012 15:41:02 +0000 (08:41 -0700)]
regcomp.c: Use calculated value instead of hard-coded

After this commit, these two cases in the switch are identical, and can
be collapsed.  This also reverses the sense of the 'if', to avoid a
negative, which is harder to read.

11 years agoregcomp.c: Collapse some switch cases
Karl Williamson [Thu, 13 Dec 2012 05:40:44 +0000 (22:40 -0700)]
regcomp.c: Collapse some switch cases

Previous commits have caused some of the cases in this switch to be
identical, so they can be collapsed.

11 years agoUse an array for some inversion lists
Karl Williamson [Thu, 13 Dec 2012 05:08:39 +0000 (22:08 -0700)]
Use an array for some inversion lists

An earlier commit placed some inversion list pointers into an array.
This commit extends that to another group of inversion lists.

11 years agoregcomp.c: Use computed value instead of hard-coded one
Karl Williamson [Thu, 13 Dec 2012 04:23:03 +0000 (21:23 -0700)]
regcomp.c: Use computed value instead of hard-coded one

The cases of this switch have used the hard-coded character class
number, depending on which case it is.  However, there is a mapping from
the switch case value to its equivalent class number.  This changes to
use that mapping

11 years agoregcomp.c: Move #define to earlier in file
Karl Williamson [Thu, 13 Dec 2012 04:17:45 +0000 (21:17 -0700)]
regcomp.c: Move #define to earlier in file

This will be needed by code being added earlier in the file than the
define is currently.  It also makes sure that it is integer division.

11 years agoUse array for some inversion lists
Karl Williamson [Thu, 13 Dec 2012 03:26:08 +0000 (20:26 -0700)]
Use array for some inversion lists

This patch creates an array pointing to the inversion lists that cover
the Latin-1 ranges for Posix character classes, and uses it instead of
the individual variables previously referred to.

11 years agoperl.c: Use loop to clear array
Karl Williamson [Thu, 13 Dec 2012 03:17:10 +0000 (20:17 -0700)]
perl.c: Use loop to clear array

These SV* variables are now in an array, and its cleaner to use a loop
instead of doing it individually.

11 years agoregcomp.c: Use table look-up instead of individual strings.
Karl Williamson [Thu, 13 Dec 2012 02:06:47 +0000 (19:06 -0700)]
regcomp.c: Use table look-up instead of individual strings.

This changes to get the name for the character class's Unicode property
via table lookup.  This is in preparation for making most of the cases
in this switch identical, so they can be collapsed.

11 years agoregcomp.c: Use values if known at compile time
Karl Williamson [Wed, 12 Dec 2012 18:35:06 +0000 (11:35 -0700)]
regcomp.c: Use values if known at compile time

When compiling a regular expression, it is too expensive to go out and
load from disk the list of code points that match a particular Posix
character class.  Some of these classes have so few code points, that
the lists are compiled in, but others are too large for that, for
example the list of code points that match \w.  Also, it is known at
compile time which of the 256 code points within the Latin-1 range match
any Posix character class.

The lists for beyond Latin-1 are demand-loaded upon first need for each,
thus the loading is deferred to execution time.  This is less efficient
than doing it a compilation time, but many many programs will never need
to load them, so the deferral is a big gain.  However, once loaded, they
stay loaded (in this thread and all sub threads).  It may be that at the
time a regex is being compiled that a list it needs has already been
loaded for some other reason.  Then, the data is already available for
free.

This commit changes to use this for some character classes whose
non-complemented forms are wanted.  Before pushing this to blead, I
realized a better way to do this, and so the code in this commit gets
ripped out some commits hence.  If I try to rebase this commit away, it
turns up too many "failure to apply" messages for the intermediate
commits, so I'm leaving this one in.

11 years agohandy.h: Move some back compat macros
Karl Williamson [Wed, 12 Dec 2012 17:35:02 +0000 (10:35 -0700)]
handy.h: Move some back compat macros

Move them to the section that is for back-compat definitions.

11 years agoAdd generic _is_(uni|utf8)_FOO() function
Karl Williamson [Wed, 12 Dec 2012 16:17:50 +0000 (09:17 -0700)]
Add generic _is_(uni|utf8)_FOO() function

This function uses table lookup to replace 9 more specific functions,
which can be deprecated.  They should not have been exposed to the
public API in the first place

11 years agohandy.h: Create isALPHANUMERIC() and kin
Karl Williamson [Wed, 12 Dec 2012 03:47:25 +0000 (20:47 -0700)]
handy.h: Create isALPHANUMERIC() and kin

Perl has had an undocumented macro isALNUMC() for a long time.  I want
to document it, but the name is very obscure.  Neither Yves nor I are
sure what it is.  My best guess is "C's alnum".  It corresponds to
/[[:alnum:]]/, and so its best name would be isALNUM().  But that is the
name long given to what matches \w.  A new synonym, isWORDCHAR(), has
been in place for several releases for that, but the old isALNUM()
should remain for backwards compatibility.

I don't think that the name isALNUMC() should be published, as it is too
close to isALNUM().  I finally came to the conclusion that
isALPHANUMERIC() is the best name; it describes its purpose clearly; the
disadvantage is its long length.  I doubt that it will get much use, but
we need something, I think, that we can publish to accomplish this
functionality.

This commit also converts core uses of isALNUMC to isALPHANUMERIC.  (I
intended to that separately, but made a mistake in rebasing, and
combined the two patches; and it seemed like not a big enough problem to
separate them out again.)

11 years agohandy.h: Move some #defines
Karl Williamson [Wed, 12 Dec 2012 03:43:59 +0000 (20:43 -0700)]
handy.h: Move some #defines

I'm moving this block of back-compat macros to later in the file, so
it comes after all the other definitions that may need to have backwards
compatibility equivalents

11 years agointrpvar.h: Place some swash pointers in an array
Karl Williamson [Tue, 11 Dec 2012 20:05:04 +0000 (13:05 -0700)]
intrpvar.h: Place some swash pointers in an array

11 years agointrpvar.h: #include handy.h
Karl Williamson [Wed, 12 Dec 2012 03:35:16 +0000 (20:35 -0700)]
intrpvar.h: #include handy.h

This will allow some mnemonics to be used in future commits

11 years agohandy.h: Guard against recursive #inclusion
Karl Williamson [Wed, 12 Dec 2012 03:34:31 +0000 (20:34 -0700)]
handy.h: Guard against recursive #inclusion

11 years agoregcomp.c: White-space, comment only
Karl Williamson [Tue, 11 Dec 2012 19:06:47 +0000 (12:06 -0700)]
regcomp.c: White-space, comment only

11 years agoperlapi: Grammar nit
Karl Williamson [Wed, 19 Dec 2012 20:44:08 +0000 (13:44 -0700)]
perlapi: Grammar nit

11 years agoutf8.c: Fix reference count in swash_to_invlist()
Karl Williamson [Fri, 21 Dec 2012 04:57:04 +0000 (21:57 -0700)]
utf8.c: Fix reference count in swash_to_invlist()

The return SV* from this function was inconsistent in its reference
count.  In some cases it creates a new SV, which has a reference count
of 1, and in some cases it returned an existing SV without incrementing
the reference count.  If the caller thought it was getting its own copy,
and decremented the reference count, it could lead to a double free.

11 years agoperlapi: Clarify return value of SvREFCNT_inc()
Karl Williamson [Thu, 20 Dec 2012 23:16:26 +0000 (16:16 -0700)]
perlapi: Clarify return value of SvREFCNT_inc()

11 years agoregexec.c: Remove redundant calculation
Karl Williamson [Thu, 20 Dec 2012 23:14:05 +0000 (16:14 -0700)]
regexec.c: Remove redundant calculation

Commit 9a902117f5d8a3ebc669e3a90eeb7cee78286a33 introduced a redundancy.
It calculates a value twice.

11 years agoXS-Typemap: bump version
Karl Williamson [Sat, 22 Dec 2012 16:32:43 +0000 (09:32 -0700)]
XS-Typemap: bump version

I'm getting cmp_version.t failures from the recent T_BOOL changes.  I
don't know why others don't seem to be.

11 years agoUpdate Unicode-Collate to CPAN version 0.97
Chris 'BinGOs' Williams [Sat, 22 Dec 2012 10:08:22 +0000 (10:08 +0000)]
Update Unicode-Collate to CPAN version 0.97

  [DELTA]

  0.97  Sat Dec 22 14:25:50 2012
    - bug fix: XS of 0.96 (if UCA_Version is 9 to 11) wrongly referred to
      DUCET for completely ignorable characters, even though the collator
      don't use DUCET.
    - separated t/notable.t from t/test.t.

11 years agoSync Module-CoreList version in Maintainers.pl with CPAN
Chris 'BinGOs' Williams [Sat, 22 Dec 2012 09:58:09 +0000 (09:58 +0000)]
Sync Module-CoreList version in Maintainers.pl with CPAN

11 years agoa better perldelta for d1bee06989
Daniel Dragan [Thu, 20 Dec 2012 04:27:45 +0000 (23:27 -0500)]
a better perldelta for d1bee06989

a better perldelta for d1bee06989

11 years agoBetter POD for newSVrv
Daniel Dragan [Thu, 20 Dec 2012 04:59:19 +0000 (23:59 -0500)]
Better POD for newSVrv

It takes me a couple times to slowly read the description to realize
what this does. The "its reference count is 1" can be misread to mean
someone must mortalize the return value of newSVrv. The "Creates
a new SV for the RV, C<rv>, to point to." can be misread to mean that
newSVrv is a macro, and will do an &() on rv to create a total of
two new SVs. An SvRV pointing to a posssibly blessed undef SV.
This is also wrong. Adding "existing" makes the point that rv
will not be created in this call.

11 years agoperldelta for d1bee06989
Tony Cook [Wed, 19 Dec 2012 22:58:55 +0000 (09:58 +1100)]
perldelta for d1bee06989

11 years ago[perl #115796] fix the T_BOOL OUTPUT typemap for parameters
Tony Cook [Wed, 19 Dec 2012 22:32:53 +0000 (09:32 +1100)]
[perl #115796] fix the T_BOOL OUTPUT typemap for parameters

11 years agowhen the output isn't RETVAL, update the SV instead of replacing it
Tony Cook [Wed, 19 Dec 2012 22:10:01 +0000 (09:10 +1100)]
when the output isn't RETVAL, update the SV instead of replacing it

Previously OUTPUT argument parameters would replace ST(n) instead of
updating it, this meant that the caller's supplied value would not be
updated.

This change means that OUTPUT T_BOOL arguments called RETVAL won't be
handled correctly, but since the OUTPUT didn't work previously for
*any* case, this is a net improvement.

11 years agoTODO the failing T_BOOL tests
Tony Cook [Wed, 19 Dec 2012 22:05:47 +0000 (09:05 +1100)]
TODO the failing T_BOOL tests

also update one test so it actually fails

11 years agoT_BOOL failure example
Daniel Dragan [Thu, 22 Nov 2012 07:51:06 +0000 (02:51 -0500)]
T_BOOL failure example

[perl #115796] T_BOOL failure example

11 years agoThe T_BOOL_2 tests should have failed, rewrite and TODO
Tony Cook [Wed, 19 Dec 2012 06:29:55 +0000 (17:29 +1100)]
The T_BOOL_2 tests should have failed, rewrite and TODO

11 years agoregexec.c: Remove some read beyond buffer ends
Karl Williamson [Wed, 19 Dec 2012 17:28:29 +0000 (10:28 -0700)]
regexec.c: Remove some read beyond buffer ends

It turns out that this paradigm used in several places in regexec.c is
wrong:

while (s + (len = UTF8SKIP(s)) <= PL_regeol) {
    ...
    s += len;
}

The reason it is wrong is that PL_regeol points to one past the end, and
this will inevitably end up reading the character at PL_regeol, which is
hence out-of-bounds.  I don't know how many times I've looked at this
code and missed this, but valgrind found it after I tried Dave
Mitchell's hack to remove the trailing NUL for testing purposes.

The way to make sure that there isn't malformed UTF-8 pointing us to
read too far would be:

while (s < PL_regeol && s + (len = UTF8SKIP(s)) <= PL_regeol) {}

This commit converts the one place that uses this safe thing to the
others:

while (s < PL_regeol) {}

In many places (but not all) in this file, we assume that the input is
well formed.  If we're going to be paranoid, it seems to me we should do
it consistently.  So I've converted this one relevant instance of
paranoia to not be, to be in line with the rest of the code.

11 years agosilence g++ warning with PL_magic_vtable_names
David Mitchell [Tue, 18 Dec 2012 23:09:46 +0000 (23:09 +0000)]
silence g++ warning with PL_magic_vtable_names

See this p5p thread for more details

    <20121218144018.GQ1842@iabyn.com>

11 years agotest the resetting of refcnt for immortals
David Mitchell [Tue, 18 Dec 2012 23:41:29 +0000 (23:41 +0000)]
test the resetting of refcnt for immortals

PL_sv_undef etc get given a very high ref count, which if it ever reaches
zero, is set back to a high value. On debugging builds, use a lower value
(1000) so that the resetting code gets exercised occasionally.

Also, replace literal (~(U32)0)/2 with the constant SvREFCNT_IMMORTAL.

11 years agoThe 5.17.7 release is done, give it a check mark on the schedule
Dave Rolsky [Tue, 18 Dec 2012 22:45:27 +0000 (16:45 -0600)]
The 5.17.7 release is done, give it a check mark on the schedule

11 years agoskip this test if we can't get an absolute path
Jesse Luehrs [Tue, 18 Dec 2012 21:06:01 +0000 (15:06 -0600)]
skip this test if we can't get an absolute path

fixes testing as root on at least solaris and openbsd

11 years agoBump the perl version in various places for 5.17.8
Dave Rolsky [Tue, 18 Dec 2012 22:21:42 +0000 (16:21 -0600)]
Bump the perl version in various places for 5.17.8

11 years agoMake a new perldelta for 5.17.8-to-be
Dave Rolsky [Tue, 18 Dec 2012 22:03:06 +0000 (16:03 -0600)]
Make a new perldelta for 5.17.8-to-be

11 years agoAdd the 5.17.7 epigraph to epigraphs.pod v5.17.7.0
Dave Rolsky [Tue, 18 Dec 2012 22:02:34 +0000 (16:02 -0600)]
Add the 5.17.7 epigraph to epigraphs.pod

11 years agoAdd known t/op/require_errors.t failure to known problems v5.17.7
Dave Rolsky [Tue, 18 Dec 2012 21:37:35 +0000 (15:37 -0600)]
Add known t/op/require_errors.t failure to known problems

11 years agoAdd 5.17.7 to perlhist
Dave Rolsky [Tue, 18 Dec 2012 16:57:02 +0000 (10:57 -0600)]
Add 5.17.7 to perlhist

11 years agoUpdate Module::CoreList for 5.17.7
Dave Rolsky [Tue, 18 Dec 2012 16:55:48 +0000 (10:55 -0600)]
Update Module::CoreList for 5.17.7

11 years agoThe 23b7025ebc commit is sufficiently documented in perldelta
Dave Rolsky [Tue, 18 Dec 2012 16:54:21 +0000 (10:54 -0600)]
The 23b7025ebc commit is sufficiently documented in perldelta

11 years agoBetter description of hash assignment bug fixes
Dave Rolsky [Mon, 17 Dec 2012 21:32:35 +0000 (15:32 -0600)]
Better description of hash assignment bug fixes

11 years agoClarify hash assignment bug fix in list context
Dave Rolsky [Mon, 17 Dec 2012 21:31:26 +0000 (15:31 -0600)]
Clarify hash assignment bug fix in list context

11 years agoTrim description of one bug fix in perldelta
Dave Rolsky [Mon, 17 Dec 2012 21:26:08 +0000 (15:26 -0600)]
Trim description of one bug fix in perldelta

11 years agoAdd more build configurations to test in the RMG
Dave Rolsky [Mon, 17 Dec 2012 20:03:49 +0000 (14:03 -0600)]
Add more build configurations to test in the RMG

11 years agoAdd placeholder for additional 23b7025ebc changes in case no one gets back to me
Dave Rolsky [Mon, 17 Dec 2012 19:38:26 +0000 (13:38 -0600)]
Add placeholder for additional 23b7025ebc changes in case no one gets back to me

11 years agoAdd an =item marker for sub-list in perldelta
Dave Rolsky [Mon, 17 Dec 2012 19:37:39 +0000 (13:37 -0600)]
Add an =item marker for sub-list in perldelta