Father Chrysostomos [Sun, 21 Jul 2013 07:38:28 +0000 (00:38 -0700)]
[perl #72766] Allow huge pos() settings
This is part of #116907, too. It also fixes #72924 as a side effect;
the next commit will explain.
The value of pos($foo) was being stored as an I32, not allowing values
above I32_MAX. Change it to SSize_t (the signed equivalent of size_t,
representing the maximum string length the OS/compiler supports).
This is accomplished by changing the size of the entry in the magic
struct, which is the simplest fix.
Other parts of the code base can benefit from this, too.
We actually cast the pos value to STRLEN (size_t) when reading
it, to allow *very* long strings. Only the value -1 is special,
meaning there is no pos. So the maximum supported offset is
2**sizeof(size_t)-2.
The regexp engine itself still cannot handle large strings, so being
able to set pos to large values is useless right now. This is but one
piece in a larger puzzle.
Changing the size of mg->mg_len also requires that
Perl_hv_placeholders_p change its type. This function
should in fact not be in the API, since it exists
solely to implement the HvPLACEHOLDERS macro. See
<https://rt.perl.org/rt3/Ticket/Display.html?id=116907#txn-1237043>.
Father Chrysostomos [Sun, 21 Jul 2013 07:30:20 +0000 (00:30 -0700)]
Add sv_pos_b2u_flags
This, similar to sv_pos_u2b_flags, is a more friendly variant of
sv_pos_u2b that works with 2GB strings and actually returns a
value instead of modifying a passed-in value in place through
a pointer.
The next commit will use this.
Father Chrysostomos [Sun, 21 Jul 2013 02:02:13 +0000 (19:02 -0700)]
perl5180delta: typo
Karl Williamson [Tue, 23 Jul 2013 16:40:07 +0000 (10:40 -0600)]
_invlist_intersection() didn't work for NULL first param
It is supposed to accept a NULL first parameter (one of the operands to
the intersection). This adds a special case for it.
Karl Williamson [Tue, 23 Jul 2013 15:42:25 +0000 (09:42 -0600)]
sv.c: Remove duplicate dups
These dupes of two tinterpreter variables were already done a few lines
above; also move a third, related, dupe to where the others are done.
Karl Williamson [Sun, 21 Jul 2013 16:49:05 +0000 (10:49 -0600)]
Remove useless assignments
These aren't used after setting. They came from blindly copying code to
this.
Karl Williamson [Sat, 20 Jul 2013 19:21:14 +0000 (13:21 -0600)]
regcomp.c: Fix #define
cl_init_zero should not be defined as S_cl_init, just 'cl_init'. The S_
prefix is wrong should cl_init be changed to have a pTHX_.
Karl Williamson [Sat, 20 Jul 2013 19:16:55 +0000 (13:16 -0600)]
regcomp.c: Remove wrong/obsolete line
This line was made obsolete and wrong by commit
a0316a6cd4a14261beb22d95530d5763e8b6756b, which changed the format of
inversion lists. This hasn't caused problems because the code currently
is #ifdef'd out.
Karl Williamson [Tue, 23 Jul 2013 15:25:36 +0000 (09:25 -0600)]
regcomp.c: Add some asserts()
Now that inversion lists are their own scalar types, we can verify that
the parameters to their manipulation functions are indeed inversion
lists. This adds such assertions to the bottom level code that deals
with the bare metal of the scalars. Functions that call these (even if
only in other asserts) didn't have asserts added to them, as they call
these anyway.
Nicholas Clark [Tue, 23 Jul 2013 12:36:03 +0000 (14:36 +0200)]
Merge the install_lib.pl/installman/installperl refactoring into blead.
Nicholas Clark [Sun, 14 Jul 2013 09:44:20 +0000 (11:44 +0200)]
install_lib.pl's samepath() should not warn if $p1 does not exist.
If $p1 is a non-existent path, then the two paths can't be the same, so
samepath() should promptly return false.
Nicholas Clark [Sun, 14 Jul 2013 09:12:17 +0000 (11:12 +0200)]
In install_lib.pl, no need to Config->import for the relocatableinc setup.
require Config; within the BEGIN block instead of using it outside it to
save creating one implicit BEGIN block, and running its import twice.
Remove the require 5.004; as the require of Config will fail if running
with anything other than the version about to be installed.
Note in installperl and installman that install_lib.pl imports Config.
Nicholas Clark [Sat, 13 Jul 2013 18:50:44 +0000 (20:50 +0200)]
Move the wrapper for File::Path::mkpath() to install_lib.pl
installperl and installman call File::Path::mkpath with identical arguments
and options, so move the repeated code into a single place.
Nicholas Clark [Sat, 13 Jul 2013 16:33:53 +0000 (18:33 +0200)]
Move {safe_,}rename() from install{man,perl} into install_lib.pl
installman's rename() was identical to installperl's safe_rename() in all
but name (and whitespace), so de-duplicate by moving the code to
install_lib.pl
Tony Cook [Tue, 23 Jul 2013 01:48:54 +0000 (11:48 +1000)]
[perl #74798] fix the build for -Duseithreads
Peter Martini [Sun, 21 Jul 2013 22:45:45 +0000 (18:45 -0400)]
Fix missing single quote in a sed in hints/aix.sh
Karl Williamson [Tue, 23 Jul 2013 00:01:30 +0000 (18:01 -0600)]
epigraphs.pod: Fix too long verbatim lines
The new 5.19.2 epigraph is prose, so it can just be block-quoted
instead of verbatim.
This commit also fixes the 5.13.11 epigraph, which already had some long
lines wrapped.
Tony Cook [Tue, 23 Jul 2013 00:38:57 +0000 (10:38 +1000)]
perldelta for
1d5bb6ba43b89
Tony Cook [Tue, 23 Jul 2013 00:24:45 +0000 (10:24 +1000)]
[perl #116190] -F implies -a, either implies -n
Previously -F without -a was a no-op, and -a without -n or -p was a
no-op, with this change, if you supply -F then both -a and -n are
implied (you can still use -p for its extra behaviour), and if you
supply -a then -n is implied.
Tony Cook [Tue, 16 Jul 2013 04:57:20 +0000 (14:57 +1000)]
[perl #116190] feed an empty stdin to run_multiple_progs() programs
Two tests for -a were attempting to read stdin and blocking with the -a
implies -n change.
Tony Cook [Tue, 16 Jul 2013 02:11:55 +0000 (12:11 +1000)]
[perl #116190] -F and -a now imply -n
Tony Cook [Tue, 16 Jul 2013 02:00:41 +0000 (12:00 +1000)]
[perl #116190] use the true and trusted fresh_perl_is()
instead of re-inventing it yet again
Aristotle Pagaltzis [Wed, 9 Jan 2013 10:26:56 +0000 (11:26 +0100)]
Make the -F switch imply -a
Tony Cook [Mon, 22 Jul 2013 23:52:29 +0000 (09:52 +1000)]
perldelta for
059639d5cdd
Tony Cook [Mon, 22 Jul 2013 23:46:55 +0000 (09:46 +1000)]
bump version for Data-Dumper
I had a stray 5.19.2 tag (possibly from testing a few weeks back) that
allowed cmp_version.t to pass
Tony Cook [Mon, 22 Jul 2013 23:18:41 +0000 (09:18 +1000)]
[perl #74798] improved useqq compatibility with the pure perl version
Currently for non-useqq, the pure perl and XS output for numbers like
these is different, but XS useqq is new, so try to remain vaguely
compatible.
Nicholas Clark [Thu, 27 Jun 2013 16:09:32 +0000 (18:09 +0200)]
Avoid read-after-free in S_scan_heredoc() if the terminator line has no "\n".
The code added by commit
112d128413206514 to fix RT #65838 (Allow here-doc
with no final newline) could in some rare cases cause a read of free()d
memory during parsing. The code itself is only run if the Perl program
ends with a heredoc (which is an unusual structure), and if the last line of
the file on disk has no terminating newline character (which is also unusual,
as many editors default to adding a final newline). The bug would be
triggered if the fixup code in S_scan_heredoc() triggered a reallocation of
the buffer in PL_linestr when adding a newline to it.
Chris 'BinGOs' Williams [Mon, 22 Jul 2013 10:55:23 +0000 (11:55 +0100)]
Module-CoreList is 2.94 on CPAN now
Chris 'BinGOs' Williams [Mon, 22 Jul 2013 08:41:01 +0000 (09:41 +0100)]
Update Module-Build to CPAN version 4.007
[DELTA]
0.4007 - Fri Jul 19 13:44:39 CEST 2013
[BUG FIXES]
- Removed undeclared test dependency on parent.pm [Leon Timmermans]
- Declared dependency on Pod::Man 2.17 for utf8 support [Leon Timmermans]
- Force generation of man pages in manify_with_utf8.t [Leon Timmermans]
0.4006 - Thu Jul 18 14:19:49 CEST 2013
[ENHANCEMENTS]
- Significantly sped up some tests by not forcing HTML docs to be
built when the user's config doesn't ask for them anyway.
[Ken Williams]
- The Module::Metadata package was split out from this distro back
in 2010. Removed its regression tests. [Ken Williams]
- Removed dependence on IO::File, replacing it with safe invocations
of open(). [Sven Dowideit]
- Added an 'extra_manify_args' parameter to facilitate man pages
containing Unicode. [Joenio Costa]
- Added an '--html_links 0' argument for the 'html' action, which
can hugely speed things up. The main effect is speeding up the
M::B tests themselves. [Ken Williams]
[BUG FIXES]
- Fix hash argument parsing in subclasses [Graham Ollis]
- Revised detildification on VMS [Craig Berry]
- Fix run_test_harness for case when $Switches is an empty string
[Victor Efimov, Ken Williams]
Chris 'BinGOs' Williams [Mon, 22 Jul 2013 08:28:39 +0000 (09:28 +0100)]
Update IPC-SysV to CPAN version 2.04
[DELTA]
2.04 - 2013-07-20
* CPAN #72458: Add 'all' export
(thanks to Milan Kocian for providing a patch)
* CPAN #79821: Install to 'site' for perl 5.11+
(thanks to Robert Sedlacek for providing a patch)
* CPAN #86736: Fix spelling of IPC_CREAT
* CPAN #78882: Document SIZE parameter of IPC::SharedMem->new()
* CPAN #78927: Fix spelling of 'nattch'
Nicholas Clark [Mon, 22 Jul 2013 08:09:50 +0000 (10:09 +0200)]
Merge the work which improves test diagnostics from run_multiple_progs().
Nicholas Clark [Mon, 15 Jul 2013 09:27:22 +0000 (11:27 +0200)]
Report useful file names and line numbers from run_multiple_progs().
Previously if tests in run_multiple_progs() failed the report gave the file
name and line number of the ok() call in run_multiple_progs(). Now, where
possible, report the file and line of the actual test program. If this
information isn't available, report the error at the file and line which
called run_multiple_progs().
This will improve error reporting from lib/charnames.t, lib/feature.t,
lib/strict.t, lib/subs.t, lib/warnings.t and t/lib/croak.t
Nicholas Clark [Mon, 15 Jul 2013 09:13:48 +0000 (11:13 +0200)]
Remove a duplicate test separator "########\n" line from the pp_sys tests.
The existing parser using split includes the second "########\n" as part of
the extracted test program, which the Perl interpreter treats as a comment
line. The parser refactoring in the next commit no longer adds the line to
the extracted test program, causing the line numbers for the warnings to
differ by one.
The extra "########\n" was added as part of commit
c521cf7c8af1697e in Dec
2010, along with the test program which follows it, and the (now) incorrect
line number expectations.
Nicholas Clark [Sun, 14 Jul 2013 18:44:50 +0000 (20:44 +0200)]
Merge the file parsing code for run_multiple_progs() into _setup_one_file().
setup_multiple_progs() calls _setup_one_file() to parse each file in turn,
and run_multiple_progs() calls it once if passed a file handle.
Nicholas Clark [Sun, 14 Jul 2013 16:58:58 +0000 (18:58 +0200)]
Move file parsing code from t/lib/common.pl to t/test.pl
Move the code that prepares input to run_multiple_progs() by parsing files
into a subroutine setup_multiple_progs(). This will enable the parsing code
in run_multiple_progs() to be merged, and the combined code to be altered to
give improved diagnostics on test failure.
Nicholas Clark [Sun, 14 Jul 2013 15:29:59 +0000 (17:29 +0200)]
Refactor the setup code in t/lib/common.pl
Eliminate the variable $line which has never been used.
(The code was added by commit
bd4dea8e97f4a8f5 in June 2001.)
Use a non-capturing group in a regex.
Check the return value of close and die if there is an error.
Explicitly count the tests found.
Avoid indirect object syntax for a method call.
Nicholas Clark [Mon, 15 Jul 2013 07:48:02 +0000 (09:48 +0200)]
lib/warnings.t should actually run the test in t/lib/warnings/doop
The file containing a single test for a warning in doop.c was added by
commit
0453d815b8a74697 in June 1999. However, as the file does not contain
an __END__ marker, the parser skips the entire contents of the file looking
for the __END__, and then assumes that the file contains no tests. This has
been true since the parser code was first implemented (in t/pragma/warning.t)
in commit
8ebc5c0145d2e355 in Jan 1997.
The simplest fix is to add an __END__ to the start of t/lib/warnings/doop
Also add some sanity checking to ensure that this doesn't happen again.
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:38:58 +0000 (09:38 +0200)]
simplify README.macosx instructions
This also removes a repeating version bumping bug.
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:28:12 +0000 (09:28 +0200)]
fix my stupid perlhist typo
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:07:37 +0000 (09:07 +0200)]
stub CoreList for v5.19.3
Aristotle Pagaltzis [Mon, 22 Jul 2013 07:05:44 +0000 (09:05 +0200)]
bump version to v5.19.3
Aristotle Pagaltzis [Mon, 22 Jul 2013 06:39:56 +0000 (08:39 +0200)]
create fresh perldelta
Aristotle Pagaltzis [Mon, 22 Jul 2013 06:33:12 +0000 (08:33 +0200)]
add v5.19.2 epigraph
Aristotle Pagaltzis [Mon, 22 Jul 2013 04:09:31 +0000 (06:09 +0200)]
update perlhist for v5.19.2 release
Aristotle Pagaltzis [Mon, 22 Jul 2013 04:09:04 +0000 (06:09 +0200)]
update perldelta for v5.19.2 release
Aristotle Pagaltzis [Mon, 22 Jul 2013 02:45:01 +0000 (04:45 +0200)]
update Module::CoreList for v5.19.2 release
Aristotle Pagaltzis [Sun, 21 Jul 2013 04:43:47 +0000 (06:43 +0200)]
Update Socket to CPAN version 2.010
[DELTA]
2013/06/24
2.010 CHANGES:
* Wrap some IPTOS_* constants, which may come from <netinet/ip.h>
* Probe for and optionally include <netinet/ip.h>
* Defeat C compilers' attempts to optimise away configure-time probes
for functions that are never called
Steffen Mueller [Sat, 20 Jul 2013 15:53:08 +0000 (17:53 +0200)]
Clarify av_shift API docs
Father Chrysostomos [Sat, 20 Jul 2013 00:58:06 +0000 (17:58 -0700)]
perldelta: #118931 is a known issue
David Mitchell [Fri, 19 Jul 2013 22:10:50 +0000 (23:10 +0100)]
Benchmark.t: remove CPU-speed-sensitive test
Benchmark.t has been randomly failing test 15 in smokes for ages.
This is the one that checks that a loop run 3*N times burns approximately
3 times more CPU than when run just N times.
For the last month the test has included a calibration loop and test,
which does much the same thing, but without using any code from
Benchmark.pm. This has failed just as much, which confirms that its an
issue with the smoke host (such as a variable speed CPU or whatever),
rather than any flaw in the Benchmark.pm library logic.
So just remove the calibration loop and the dodgy test.
Reini Urban [Thu, 18 Jul 2013 19:50:35 +0000 (14:50 -0500)]
more op_folded support: B, dump
also add more B::OP accessors for the missing bitfields
Father Chrysostomos [Fri, 19 Jul 2013 01:51:54 +0000 (18:51 -0700)]
Add Niels Thykier to AUTHORS
Niels Thykier [Wed, 17 Jul 2013 18:59:54 +0000 (20:59 +0200)]
op.c: Add op_folded to BASEOP
Add a new member, op_folded, to BASEOP. It is replacement for
OPpCONST_FOLDED (which can only be set on OP_CONST). At the moment
OPpCONST_FOLDED remains, as it is exposed in B (e.g. B::Concise relies
on it).
Signed-off-by: Niels Thykier <niels@thykier.net>
Father Chrysostomos [Wed, 17 Jul 2013 06:29:25 +0000 (23:29 -0700)]
toke.c:yylex: assert that PL_linestr is not a COW
and fix the one bug this uncovers.
With COW enabled all the time, it is easy to introduce bugs like this.
See also
4e917a04. In short, toke.c expects to be able to modify
PL_linestr’s buffer. Putting this assertion in yylex (a hot path)
will make sure PL_linestr never becomes a COW again.
Father Chrysostomos [Fri, 19 Jul 2013 15:51:47 +0000 (08:51 -0700)]
sv.c: Assert that sv_[ivp]v are not passed aggregates
The lack of assertions can hide bugs. See
32a609747bffb for instance
Karl Williamson [Fri, 19 Jul 2013 15:50:27 +0000 (09:50 -0600)]
locale.c: Add missing STATIC to fcn decl
Karl Williamson [Wed, 17 Jul 2013 04:02:46 +0000 (22:02 -0600)]
Move some tests from cpan/version to t/run
Commit
fb7942811c8097ed2e61fd35a90345226546176a recently moved
version.pm to cpan. Earlier, in commit
b127e37e51c21b0a36755dcd19811be931a03d83, I had added tests to version's
.t that arguably belonged elsewhere. I did this because I thought that
this .t was the only one around that had the infrastructure already
written to allow such tests to easily be added, and it was in /lib so
p5p controlled it. (That infrastructure being finding locales with the
decimal point not a dot.) Since then, I found that t/run/locale.t has
similar infrastructure. Given that version now may end up being cpan
upstream, I thought it best to move those tests to t/run/locale.t
I notice that changes to this .t prior to these no longer were careful
to avoid 'use locale' in case the platform doesn't support it, and there
have been no field problems; so I just went ahead and did a 'use locale'
too.
Karl Williamson [Wed, 17 Jul 2013 04:05:57 +0000 (22:05 -0600)]
cpan/version/t/07locale.t: Actually test what is claimed
Commit
b127e37e51c21b0a36755dcd19811be931a03d83 wrongly changed two
tests, and failed to change a third. One of the two ended up doing:
ok ("$ver eq '1,23'", ...);
That's always going to succeed as ok() doesn't do an eval; it just looks
at the result of the expression, which in this case was a non-empty
string.
The second test was changed from an 'eq' to '=='. It had this diff:
- is ($v, "1.23", "Locale doesn't apply to version objects");
+ ok ($v == "1.23", "Locale doesn't apply to version objects");
(The code for is() does an 'eq'.) The is() call is made from within the
scope of a "use locale" in which the decimal point character is a comma,
but version objects are supposed to always use a dot, regardless of the
locale. The == will numify the operands, potentially throwing away the
locale's decimal point character. Therefore the test should use an
'eq'.
Before these changes, the two tests also didn't do what they purported
(and hence the motivation for the changes). The tests previously used
'is()', which is defined in a different file which is outside the locale
scope, so that the scalars ($v and $ver) there should have a dot even
if they have a comma within locale scope, and hence doing an is() would
not catch the bug being tested against. Hence the third test
(overlooked in the earlier commit) remained wrong until now.
Karl Williamson [Wed, 17 Jul 2013 04:01:08 +0000 (22:01 -0600)]
sv.h: Comments added/typo fixed.
Ricardo Signes [Fri, 19 Jul 2013 14:58:23 +0000 (10:58 -0400)]
perldelta: minor grammar fixes
Daniel Dragan [Sat, 22 Dec 2012 14:34:40 +0000 (09:34 -0500)]
remove some instruction bloat in S_find_uninit_var
VC 2003 -O1 put down SvIV(cSVOPx_sv(kid)) twice in asm. Not sure why.
Explicitly store the values to make it more obvious to the compiler to
evaluate the SvIV only once, then do the branch, not do the negate branch,
then in a negate branch do a SvIV. Result is less machine code read by the
CPU. The .text section dropped 0xC01FF to 0xC018F after this change.
Tony Cook [Fri, 12 Jul 2013 07:12:46 +0000 (17:12 +1000)]
handle multiple children exiting in perlipc example
Tony Cook [Thu, 11 Jul 2013 07:03:44 +0000 (17:03 +1000)]
pod2html output concerns
Craig A. Berry [Thu, 18 Jul 2013 20:19:51 +0000 (15:19 -0500)]
Remove 5.005 thread support from configure.com.
Follow-up to
5ff367e3adebb49.
Chris 'BinGOs' Williams [Thu, 18 Jul 2013 11:30:07 +0000 (12:30 +0100)]
Update Parse-CPAN-Meta to CPAN version 1.4405
[DELTA]
1.4405 2013-07-17 21:43:34 America/New_York
- Fixed incorrect "return ... or die ..." constructs
- Converted distribution to Dist::Zilla management
- Noted new repository location in the Github Perl-Toolchain-Gang
organization
Nicholas Clark [Wed, 17 Jul 2013 10:23:42 +0000 (12:23 +0200)]
bisect.pl now accepts repeated -e options, just like perl.
Father Chrysostomos [Wed, 17 Jul 2013 06:06:53 +0000 (23:06 -0700)]
perldelta for =>
Father Chrysostomos [Sat, 13 Jul 2013 06:37:26 +0000 (23:37 -0700)]
Allow => to quote built-in keywords across lines
This is the second try.
5969c5766a5d3 had a bug in it under non-
MAD builds.
If I have a sub I can use its name as a bareword as long as I suffix
it with =>, even if the => is on the next line:
$ ./perl -Ilib -e 'sub tim; warn tim' -e '=>'
tim at -e line 1.
If I want to use a built-in keyword’s name as a bareword, I can put =>
after it:
$ ./perl -Ilib -e 'warn time =>'
time at -e line 1.
But if I combine the two (keyword + newline), it does not work:
$ ./perl -Ilib -e 'warn time' -e ' =>'
1373611283 at -e line 1.
unless I override the keyword:
$ ./perl -Ilib -Msubs=time -e 'warn time' -e ' =>'
time at -e line 1.
=> after a bareword is checked for in two places in toke.c. The first
comes before a comment saying ‘NO SKIPSPACE BEFORE HERE!’; it only
skips spaces and finds a => on the same line. The second comes later;
it skips vertical space and comments, too.
But the second check is in a code path that is not reached by keywords
that are not overridden (as is the ‘NO SKIPSPACE’ comment).
This commit adds an extra check for built-in keywords after we have
determined that the keyword is not overridden. In that case, there is
no reason we cannot use skipspace, as we no longer have to worry about
what PL_oldbufptr etc. point to.
This commit leaves __DATA__ and __END__ alone, since they
are special, problematic and controversial. (See, e.g.,
<https://rt.perl.org/rt3/Ticket/Display.html?id=78348#txn-1234355>.)
Allowing whitespace to be scanned across line boundaries without
increasing the line number (something this commit has to do to make
this work) can cause the way PL_linestr is handled to change.
PL_linestr usually holds just the current line when reading from a
handle. Now it can hold the current line plus the next line or seve-
ral lines, depending on how much whitespace is to be found there.
When '\n' or '#' was encountered, the lexer would modify the buffer in
place and add a null, setting PL_bufend to point to that null. That
would make it look as though the end of the line had been reached, and
avoided having to scan to find the end of a comment.
In string eval and quote-like operators, the end of the comment does
have to be scanned for. We can’t just fake EOL and read the next
line of input.
Under MAD builds, the end of the comment was being scanned for any-
way, even when reading from a handle. So everything worked under MAD,
which was what I tested
5969c5766a5d3 under.
This commit changes the '\n' and '#' handling to match the MAD code
(scan for the end of the comment instead of faking a buffer trunca-
tion), which
5969c5766a5d3 failed to do.
Tony Cook [Wed, 17 Jul 2013 01:14:30 +0000 (11:14 +1000)]
ignore the build product lib/version.pod
fb7942811 moved version from lib/ to cpan/ and added most of the needed
lib/.gitignore entries, missing only this one.
Tony Cook [Wed, 17 Jul 2013 01:09:21 +0000 (11:09 +1000)]
[perl #74798] useqq implementation for xs
Tony Cook [Wed, 10 Jul 2013 04:54:20 +0000 (14:54 +1000)]
handle xs Useqq dumping of strings with an escape followed by a digit
The original patch didn't handle a string like "\x001" correctly, encoding
it as "\01" rather than "\0001".
Added tests for this case and some possible corner cases
Tony Cook [Wed, 10 Jul 2013 04:19:17 +0000 (14:19 +1000)]
adjust indentation to match other DD code
Slaven Rezic [Wed, 10 Jul 2013 04:18:18 +0000 (14:18 +1000)]
Data::Dumper: useqq implementation for xs
Tests are mainly unchanged, just a "cheat" and a couple of TODOs were
removed.
Karl Williamson [Tue, 16 Jul 2013 19:59:03 +0000 (13:59 -0600)]
Merge branch 'const_posix_invlists' into blead
This is the second attempt to put this functionality into blead. The
first was in commit
dab1d6f279e5792c6a935eeaeeec652a883df979. Its
elements had to be backed out because it turns out there were array
bounds errors. This new commit should have fixed those. The revised
commit message is:
What characters certain POSIX classes match, like [[:xdigit:]] are
compiled into a C header file, thus avoiding the necessity of reading
them in from disk at run-time. This merge makes those fully const, so
that they can get loaded as part of a read-only text segment. The sv's
that contain these are set so that SvLEN is 0; this means that copies
are not made when they are dup'd, such as when threads are created.
A new svtype is created for inversion lists, using the single available
slot, renumbering them. The first few commits instead use an existing
svtype, repurposing some of its fields for use by inversion lists. This
was done so that this could be done in a maintenance release, if
necessary. (Their not being fully const can interfere with
-DPERL_GLOBAL_STRUCT_PRIVATE.) And also, should it become necessary to
create an svtype for some other purpose, we can revert to that point in
the branch
Karl Williamson [Fri, 12 Jul 2013 21:11:26 +0000 (15:11 -0600)]
Remove redundant field from inversion lists
The number of elements in an inversion list is a simple calculation
based on SvCUR(). Prior to this patch there was a field that contained
that number directly, and the two values diverged, causing a bug. A
single value can't get out-of-sync with itself.
Karl Williamson [Fri, 12 Jul 2013 20:07:49 +0000 (14:07 -0600)]
Add parameter to internal function
The function invlist_set_len() has to be called after the offset header
field in an inversion list has been set. To make sure that future
maintainers don't forget to do this, add the parameter for the 'offset'
to its call, so it can't be called without having this value.
Karl Williamson [Fri, 12 Jul 2013 17:30:16 +0000 (11:30 -0600)]
regcomp.c: Rmv now redundant setting
SvCUR is now properly set in invlist_set_len(). There is no need to do
it outside that function.
Karl Williamson [Fri, 12 Jul 2013 03:56:46 +0000 (21:56 -0600)]
Fix off-by-one error in inversion lists.
The first commit of this topic branch added a dummy 0 element to the end
of certain inversion lists to work around an off-by-one error. This
commit makes the necessary changes to stop that error, and to remove
the dummy element. SvCUR() and invlist_len() now are kept in sync.
Karl Williamson [Fri, 12 Jul 2013 01:44:56 +0000 (19:44 -0600)]
regcomp.c: Reorder a couple of function calls
A future commit with require that the offset be known before the length
gets set. This prepares for that.
Karl Williamson [Fri, 12 Jul 2013 01:38:53 +0000 (19:38 -0600)]
regcomp.c: Remove now useless initialization
This code was designed to cause a segfault by initializing an offset
into an address to a very large value. But now, it is stored as a bool,
so there is not point in doing this. We also remove an assert that it
is a bool, because it always has to be.
Karl Williamson [Fri, 12 Jul 2013 01:16:55 +0000 (19:16 -0600)]
regcomp.c: Only White-space, comments, name of variable change
Karl Williamson [Sat, 6 Jul 2013 21:33:57 +0000 (15:33 -0600)]
Reinstate "Use new Svt_INVLIST for inversion lists."
This reverts commit
2e0b8fbeab3502bee36f25825c3cdd0d075c4fd3, which
reverted
e0ce103ae532f9576f54a5938a24d1ee98dfb928, thus reinstating the
latter commit. It turns out that the error being chased down was not
due to this commit.
Its original message was:
This converts inversion lists to use their own scalar type.
Karl Williamson [Sat, 6 Jul 2013 21:29:11 +0000 (15:29 -0600)]
Reinstate "Create SVt_INVLIST"
This reverts commit
49cf1d6641a6dfd301302f616e4f25595dcc65d4, which
reverted
e045dbedc7da04e20cc8cfccec8a2e3ccc62cc8b, thus reinstating the
latter commit. It turns out that the error being chased down was not
due to this commit.
Its original message was:
This reshuffles the svtype enum to remove the dummy slot created in a
previous commit, and add the new SVt_INVLIST type in its proper order.
It still is unused, but since it is an extension of SVt_PV, it must be
greater than that type's enum value. Since it can't be upgraded to any
other PV type, it comes right after SVt_PV.
Affected tables in the core are updated.
Karl Williamson [Sat, 6 Jul 2013 21:10:14 +0000 (15:10 -0600)]
Reinstate "regcomp.c: Move some #defines to only file that uses them"
This reverts commit
247f9b19318882fd9a52fe49aa31fc8d3d3db4f7, which
reverted
05944450e0fc82eb8fc1fb5a4bf63f23785262a0, thus reinstating the
latter commit. It turns out that the error being chased down was not
due to this commit.
Its original message was:
These were used in a header file to provide synchronization between
files. However, the only other file that would need them is a .pl file
which doesn't have access to them. So simplify things so that the
variables are either removed entirely if only used in a single place, or
are #defined in the area where they are used
Karl Williamson [Sat, 6 Jul 2013 20:56:39 +0000 (14:56 -0600)]
Reinstate "regcomp.c: Make C-array inversion lists const"
This reverts commit
18505f093a44607b687ae5fe644872f835f66313, which
reverted
241136e0ed70738cccd6c4b20ce12b26231f30e5, thus reinstating the
latter commit. It turns out that the error being chased down was not
due to this commit.
Its original message was:
The inversion lists that are compiled into a C header are now const.
Karl Williamson [Sat, 6 Jul 2013 20:44:32 +0000 (14:44 -0600)]
Reinstate "regcomp.c: Move inversion list hdr field to SV hdr"
This reverts commit
2eb2feb9f4a226d0fe0fd3d66e2ce341296f0072, which
reverted
d913fb457b732da4c31d0d1b8c085989a7ecd12d, thus reinstating the
latter commit. It turns out that the error being chased down was not
due to this commit.
Its original message was:
This moves the final field that can vary from the inversion list data
structure into the header of the SV that contains it. With this commit,
the body of an inversion list is now const.
The field is converted to a U8, to correspond with the header field in
the SV type that we currently use to hold inversion lists.
Karl Williamson [Sat, 6 Jul 2013 20:29:35 +0000 (14:29 -0600)]
Reinstate "regcomp.c: Change, variable, fcn name"
This reverts commit
0b58015e05b2ab93b080b7c49a70bf82435363c0, which
reverted
875c4e2c5193b5245da578b222e9c93aad31d93b, thus reinstating the
latter commit. It turns out that the error being chased down was not
due to this commit.
Its original message was (slightly revised for clarity):
These have always been slightly misnamed, but a recent commit made them
more so. The old name contained "zero", but now there is a new element
which always has zero. The renamed element indicates whether the
inversion list is offset, that is if the beginning is the zero element,
or if the beginning is the next element beyond the zero element.
Karl Williamson [Sat, 6 Jul 2013 20:13:35 +0000 (14:13 -0600)]
Reinstate "regcomp.c: Move 2 hdr inversion fields to SV hdr"
This reverts commit
67434bafe4f2406e7c92e69013aecd446c896a9a, which
reverted
4fdeca7844470c929f35857f49078db1fd124dbc, thus reinstating the
latter commit. It turns out that the error being chased down was not
due to this commit.
Its original message was:
This commit continues the process of separating the header area of
inversion lists from the body. 2 more fields are moved out of the
header portion of the inversion list, and into the header portion of the
SV that contains it.
Karl Williamson [Sat, 6 Jul 2013 19:58:55 +0000 (13:58 -0600)]
Reinstate "regcomp.c: Remove unused data structure field"
This reverts commit
c7995b20ccfbb4248b23aeae9fd1eab838852fcc, which
reverted
4b98096221966ea01c046f4f61b2dc4f60b534b9, thus reinstating
the latter commit. It turns out that the error being chased down was
not due to this commit.
Its original message was:
This removes a field that is set in the inversion list data structure
and examined just once. And that sole examiner is the function that
calls the function that does the set. In other words X calls Y passing
it data D. Y puts D into a structure. Upon return from Y, X looks for
D in the structure. No one else looks at D. X might just as well have
looked at D directly, without involving Y, and without the structure
needing a space for D.
Karl Williamson [Sat, 6 Jul 2013 18:39:22 +0000 (12:39 -0600)]
Reinstate "regcomp.c: Make inversion lists SVt_PVLV"
This reverts commit
ac7a6f5849b5fd57b2e837f4ddbc18c992610e9c which
reverted
2c3365de8c1168f115576a4976d067e3b911c490, thus reinstating the
latter commit. It turns out that the error being chased down was not
due to this commit.
This commit additionally changes some now-obsolete wording in a pod.
This change was not in
2c3365de8c1168f115576a4976d067e3b911c490.
The original message for commit
2c3365de8c1168f115576a4976d067e3b911c490
was:
This is the 2nd step in separating the inversion list body from header.
This commit gives inversion lists the header from a SVt_PVLV, and
repurposes one of its fields into being the length of the inversion
list.
This is a temporary measure, in case binary compatibility is an issue.
Future commits will create a new SV type just for inversion lists. This
SV type was chosen because it has a sufficient number of fields to
accommodate all the header fields from inversion lists.
Karl Williamson [Sat, 6 Jul 2013 18:26:43 +0000 (12:26 -0600)]
Reinstate + fix "Revert "regcomp.c: Add a constant 0 element before inversion lists" "
This reverts commit
de353015643cf10b437d714d3483c1209e079916 which
reverted
533c4e2f08b42d977e5004e823d4849f7473d2d0, thus reinstating it,
plus this commit adds a fix to get it to pass under Address Sanitizer.
The root cause of the problem is that there are two measures of the
length of an inversion list. One is SvCUR(), and the other is
invlist_len(). The original commit caused these to get off-by-one in
some cases. The ultimate solution is to only store one value, and
return the other one based off that. Rather than redo the whole branch,
I've taken an easier way out, which is to add a dummy element at the end
of some inversion lists, so that they aren't off-by-one. Then the other
patches from the original branch will be applied. Each will be
tested with Address Sanitizer. Then the work to fix the underlying
problem will be done.
The original commit's message was:
This commit is the first step to separating the header from the body of
inversion lists. Doing so will allow the compiled-in inversion lists to
be fully read-only.
To invert an inversion list, one simply unshifts a 0 to the front of it
if one is not there, and shifts off the 0 if it does have one.
The current data structure reserves an element at the beginning of each
inversion list that is either 0 or 1. If 0, it means the inversion list
begins there; if 1, it means the inversion list starts at the next
element. Inverting involves flipping this bit.
This commit changes the structure so that there is an additional element
just after the element that flips. This new element is always 0, and
the flipping element now says whether the inversion list begins at the
constant 0 element, or the one after that.
Doing this allows the flipping element to be separated in later commits
from the body of the inversion list, which will always begin with the
constant 0 element. That means that the body of the inversion list can
be const.
Karl Williamson [Tue, 16 Jul 2013 18:41:45 +0000 (12:41 -0600)]
embed.fnc: Clarify comments on E,X flag usage; nit
Nicholas Clark [Tue, 16 Jul 2013 09:23:50 +0000 (11:23 +0200)]
Move version from lib/ to cpan/
Whilst there are still several differences between what's in core and what's
in the CPAN tarball, moving the files in core to their own directory with
the same layout as the CPAN distribution simplifies things.
Somewhat surprisingly, none of the toolchain modules C<use version;> so
there's no need to add to lib/buildcustomize.pl
Father Chrysostomos [Tue, 16 Jul 2013 06:52:44 +0000 (23:52 -0700)]
perldelta for #27010
Father Chrysostomos [Tue, 16 Jul 2013 06:51:15 +0000 (23:51 -0700)]
[perl #27010] Make tie work through defelems
When elements of @_ refer to nonexistent hash or array elements, then
the magic scalar in $_[0] delegates all set/get actions to the element
in represents, vivifying it if needed.
tie/tied/untie, however, were not delegating to the element, but were
tying the the magical ‘deferred element’ scalar itself.
Father Chrysostomos [Tue, 16 Jul 2013 05:49:31 +0000 (22:49 -0700)]
embed.fnc: E does not imply X
I thought it did.
James E Keenan [Wed, 10 Jul 2013 02:13:10 +0000 (04:13 +0200)]
Convert lib/FileHandle.t to use of Test::More; provide descriptions.
Previously, file used hand-coded 'print "ok"' statements and no tests had
descriptions (a.k.a. labels or names). Convert to use of Test::More functions
and provide descriptions for all individual tests.
Previously, file used global variables extensively and did not 'use strict'
(except 'use strict subs'). The globals have been converted to lexicals
where appropriate and the file now runs fully under strictures. Other
than that, no attempt was made to improve the design of the file or the
quality of the tests. (That can be done in a later RT, if desired.)
Thanks to Peter Martini for guidance, Dagfinn Ilmari Mannsåker for guidance
and code review on list and Tony Cook for additional review.
For: RT #118883
Father Chrysostomos [Tue, 16 Jul 2013 02:00:21 +0000 (19:00 -0700)]
perldelta for #77814
Father Chrysostomos [Tue, 16 Jul 2013 01:57:01 +0000 (18:57 -0700)]
[perl #77814] Make defelems propagate pos
When elements of @_ refer to nonexistent hash or array elements, then
the magic scalar in $_[0] delegates all set/get actions to the element
in represents, vivifying it if needed.
pos($_[0]), however, was not delegating the value to the element, but
storing it on the magical ‘deferred element’ scalar.
Father Chrysostomos [Mon, 15 Jul 2013 07:21:55 +0000 (00:21 -0700)]
perldelta for vstrings and set-magic