| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Locale initialization and setting on Windows haven't been as
described in perllocale for setting locales to "". This is because that
tells Windows to use the system default locale, as set through the
Control Panel, but on POSIX systems, it means to look at various
environment variables.
This commit creates a wrapper for setlocale, used only on Windows, that
looks for the appropriate environment variables when called with a ""
input locale. If none are found, it continues to use the system default
locale.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 4571f4a caused the gp to have a refcount of 1, not 0, in
gp_free when the contents of the glob are freed. This makes
gv_try_downgrade see the gv as a candidate for downgrading in
this example:
sub Fred::AUTOLOAD { $Fred::AUTOLOAD }
undef *{"Fred::AUTOLOAD"};
When the glob is undefined, the sub inside it is freed, and the
gvop ($Fred::AUTOLOAD), when freed, tries to downgrade the glob
(*Fred::AUTOLOAD). Since it is empty, it deletes it completely from
the containing stash, so the GV is freed out from under gp_free, which
is still using it, causing an assertion failure.
We can trigger a similar condition more explicitly:
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; undef *{"foo"}'
This bug is nothing new. On a non-debugging 5.18.2, I get this:
$ perl5.18.2 -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; undef *{"foo"}'
Attempt to free unreferenced glob pointers at -e line 1.
Segmentation fault: 11
That crashes in pp_undef after the call to gp_free, becaues pp_undef
continues to manipulate the GV.
The problem occurs not only with pp_undef, but also with other func-
tions calling gp_free:
sv_setsv_flags:
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; *{"foo"}="bar"'
glob_assign_glob:
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = bless []; *{"foo"}=*bar'
sv_unglob, reached through various paths:
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; ${"foo"} = 3'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; utf8::encode(${"foo"})'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; open bar, "t/TEST"; ${"foo"} .= <bar>'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; ${"foo"}++'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = do {local *bar}; $${"foo"} = bless []; undef ${"foo"}'
$ ./miniperl -e 'DESTROY{delete $::{foo}} ${"foo"} = 3; ${"foo"} =~ s/3/${"foo"} = do {local *bar}; $${"foo"} = bless []; 4/e'
And there are probably more ways to trigger this through sv_unglob.
(I stopped looking when I thought of the fix.)
This patch fixes the problem by protecting the GV using the mortals
stack in functions that call gp_free. I did not change gp_free
itself, since it is an API function that as yet does not touch the
mortals stack, and I am not sure that should change. All of its
callers that this patch touches already do sv_2mortal in some cir-
cumstances.
|
|
|
|
|
| |
• Consistent indentation
• Missing <> around e-mail address
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We only need to turn off the SvOK flags when the destination was not
already a glob.
Up till now, the code was doing SvOK_off twice, and
isGV_with_GP_on/off several times to avoid assertion failures.
If we already have a glob, then the only SvOK flags that can be on
already are SVpgv_GP (which needs to be on) and possibly SVf_UTF8,
which is harmless.
The only difference is that now the dumped glob in this one-liner will
have its UTF8 flag set:
$ ./perl -Ilib -MDevel::Peek -e 'use utf8; "".*φου; *φου = *bar; Dump *φου'
whereas it didn’t before. That is of no consequence, as the UTF8 flag
is only meaningful after stringification, which resets it.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
[DELTA]
1.06 2014-02-14 NEILB
- e2charnum() was using \d but should use [0-9].
RT#70246 report and fix from MARCGREEN
- Added a bunch of pod-related links to SEE ALSO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RT #121248
Part of my recent refactoring of the code in re_intuit_start() - the bit
that searches for \n's in /^../m patterns (d0880ea) - introduced a
segfault, due to the count arg of memchr() going negative.
This is due to the stclass code (which I haven't refactored yet)
incrementing rx_origin beyond the last point it could match, then jumping
back to the MBOL block. In theory the stclass block should be fixed, but
until I get round to that, I've just added a test to the MBOL block
instead.
|
|
|
|
|
|
|
|
| |
[DELTA]
0.011 2014-02-13 20:30:30-05:00 America/New_York
- Generated from ETHER/YAML-Tiny-1.60.tar.gz
|
| |
|
| |
|
|
|
|
|
| |
See commit b3a2acfa0c0e4f8e48e1f6eb4d6fd143f293d2c6
and http://markmail.org/message/x2sr55ekvos5k6wc
|
| |
|
|\ |
|
| |
| |
| |
| |
| | |
Run a program within t/test_pl/tempfile.t that uses tempfile() to make
sure that the temp file is removed when the tests are done.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This convenience function causes files to be removed in the same
way that tempfile() does.
It uses the same variable that tempfile() does, to catch and
warn on any collisions.
|
| | |
|
|/
|
|
| |
Tony: add a missing local
|
|
|
|
|
| |
Update email of Alan Haggai Alavi; consolidate all email addresses
in Porting/checkAUTHORS.pl.
|
|
|
|
| |
broken since 5.8.9
|
| |
|
|
|
|
| |
I misread the code when I added these comments
|
|
|
|
|
|
|
|
|
|
|
|
| |
For regexec.c, one compiler amongst our smokers believes there is a path
where this array can be used uninitialized; it's easiest to just
initialize it, even though I think the compiler is wrong, unless it is
optimizing incorrectly, in which case, it would be still be best to
initialize it.
For locale.c, this is just the well-known gcc bug that they refuse to
fix concerning a (void) cast when the function has been declared to
require not ignoring the resul
|
|
|
|
|
|
|
|
|
|
| |
[DELTA]
Version 3.65 Feb 11, 2014
[INTERNALS]
- Update Makefile to refine where CGI.pm gets installed
(Thanks to bingo, rjbs: https://github.com/markstos/CGI.pm/pull/30)
|
| |
|
|
|
|
|
|
|
| |
Rather than assuming that we are on a unix system with the
standard kit, we can rely on this neat little programming
language that provides their behavior and is already assumed
to be present!
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[DELTA]
0.28 2014/02/10 16:17:59
[CHANGES]
* Renamed internal _configure method to _io_socket_ip__configure to
avoid clashes with modules that try to subclass IO::Socket::INET
[BUGFIXES]
* Disable AI_ADDRCONFIG during one-sided 'v6 tests as sometimes it
would otherwise fail
* Skip the SO_BROADCAST test on OSes that fail with EACCES (RT92502)
|
| |
|
|
|
|
|
|
|
|
|
| |
If we just did an sv_setpvs on it, the SvPV_force_nolen should not do
anything useful, so let's not.
Side note: s/TARG/left/ in the enclosing block because they are the same
pointer, so why use a define that needs grokking by the reader of the
code if the local variable is guaranteed to be the same?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[DELTA]
0.4205 - Sun Feb 9 17:51:22 CET 2014
[BUG FIXES]
- FIX license code regression for artistic license [Roy Ivy III, Leon Timmermans]
- Don't swallow ExtUtils::CBuilder loading errors [Matthew Horsfall, Leon Timmermans]
- Handle testing on cross-compile builds [Brian Fraser]
- Protect against platforms without getpw{nam,uid} [Brian Fraser]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[DELTA]
1.05 2014-02-09 NEILB
* Added PREREQ_PM, MIN_PERL_VERSION, LICENSE and repo to Makefile.PL
* Made strict- and warnings-clean.
* Fixed syntax error in abstract: RT#49985 from JDHEDDEN
* Fixed typo reported in RT#85374 by dsteinbrunner
* Renamed this file to Changes and reformatted as per CPAN::Changes::Spec
* Deleted META.yml so MakeMaker will generate MYMETA.{yml,json}
* Noted in pod that now being maintained by NEILB
* Added link to github repo in pod
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This says ‘an ARRAY’:
$ perl -Mstrict -e '@{"a"}'
Can't use string ("a") as an ARRAY ref while "strict refs" in use at -e line 1.
This says ‘a ARRAY’:
$ ./miniperl -e '$/=[]'
Setting $/ to a ARRAY reference is forbidden at -e line 1.
It ought to say ‘an’.
|
| |
|
|
|
|
|
| |
It’s faster to pass the HEK directly instead of creating and
throwing away SVs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 2e73d70e52 broke this (made it vivify) by propagating lvalue
context to the branches of || and && (to fix another bug). It broke
App::JobLog as a result.
Because foreach does not do defelem magic (i.e., it vivifies), this
ends up extending vivification to happen where it did not before.
Fixing foreach to do defelem magic (create ‘deferred element’ scalars,
the way sub calls do, to avoid vivifying immediately) would be another
way to fix this, but it is controversial. See ticket #2166.
So, if either argument to || (or &&) is a vivifying op, don’t propa-
gate the lvalue context, unless this is the return value of an lvalue
sub (necessary for if/else with implicit return to work correctly in
lvalue subs).
|
|
|
|
|
| |
0824d667 added the flag. 9026059dcee8 removed the flag but left it in
B::Concise.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise pod like this:
The second situation is caused by an eval accessing a lexical subroutine
that has gone out of scope, for example,
sub f {
my sub a {...}
sub { eval '\&a' }
}
f()->();
is turned into this:
The second situation is caused by an eval accessing a variable that has
gone out of scope, for example,
sub f {
my $a;
sub { eval '$a' }
}
f()->();
instead of this:
The second situation is caused by an eval accessing a variable that has
gone out of scope, for example,
sub f {
my $a;
sub { eval '$a' }
}
f()->();
I don’t know how to test this without literally copying and pasting
parts of diagnostics.pm into diagnostics.t. But I have tested it man-
ually and it works.
|
|
|
|
|
|
|
|
| |
This variable only held the package name. __PACKAGE__ is faster,
as it allows constant folding.
diagnostics.pm just happens to be older than __PACKAGE__, which was
introduced as recently as 1997 (68dc074516).
|
| |
|
|
|
|
|
|
|
|
|
| |
to avoid splain output like this on 80-column terminals:
rewinddir() attempted on invalid dirhandle foo at -e line 1 (#1)
(W io) The dirhandle you tried to do a rewinddir() on is either closed or no
t
really a dirhandle. Check your control flow.
|
|
|
|
| |
Dev versions are an artefact of the developement process.
|
|
|
|
| |
Also, non-integer should be hyphenated.
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Perl_re_intuit_start() is the main run-time optimising function for the
regex engine. It tries to either quickly reject a match, or find a suitable
starting point for the NFA.
Unfortunately it is impenetrable code, with 13 labels and no large scale
loop or other constructs, and has several severe performance issues with
long utf8 strings.
This series of commits attempts to fix the performance issues, audit the
code for utf8 and other correctness, and refactor and simplify the code,
as well as improve the documentation. In particular it fixes RT#120692.
With gcc on x86_64, this branch decreases the binary size of the function
by around 15%.
Much of my work on this branch has been an iterative process of wondering
why a piece of code is the way it is, adding some assertions and seeing
what breaks in the test suite, then using that info to improve the code or
documentation.
This work isn't finished yet; in particular I haven't yet audited and
refactored the stclass block of code towards the end of the function.
I also have more refactorisations and some more more optimisations
still to go, as well as general tidying up of the documentation.
|
| |
| |
| |
| |
| |
| | |
if (check_ix)
isn't very clear, so clarify it a bit.
|