summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Emulate POSIX locale setting on WindowsKarl Williamson2014-02-159-10/+119
| | | | | | | | | | | | | 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.
* t/test.pl: Add option to runperl to suppress STDERRKarl Williamson2014-02-151-2/+8
|
* [perl #121242] Fix crash in gp_free when gv is freedFather Chrysostomos2014-02-153-2/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* AUTHORS formatting clean-upFather Chrysostomos2014-02-151-10/+10
| | | | | • Consistent indentation • Missing <> around e-mail address
* sv.c: Don’t flip flags so many times in glob_assign_globFather Chrysostomos2014-02-151-5/+0
| | | | | | | | | | | | | | | | | | | | 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.
* Remove a redundant EXTEND (its followed by XPUSHs)Peter Martini2014-02-151-1/+0
|
* Update Pod-Escapes to CPAN version 1.06Chris 'BinGOs' Williams2014-02-143-7/+17
| | | | | | | | | | [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
* re_intuit_start(): fix SEGV in /^../m codeDavid Mitchell2014-02-142-3/+10
| | | | | | | | | | | | | | 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.
* Update CPAN-Meta-YAML to CPAN version 0.011Chris 'BinGOs' Williams2014-02-1472-2978/+4393
| | | | | | | | [DELTA] 0.011 2014-02-13 20:30:30-05:00 America/New_York - Generated from ETHER/YAML-Tiny-1.60.tar.gz
* perldelta updatesTony Cook2014-02-141-0/+65
|
* Fix small typo (dsb -> dsv)Matthew Horsfall (alh)2014-02-141-2/+2
|
* perldelta.pod: Fix broken linksKarl Williamson2014-02-132-3/+3
| | | | | See commit b3a2acfa0c0e4f8e48e1f6eb4d6fd143f293d2c6 and http://markmail.org/message/x2sr55ekvos5k6wc
* sv.c: Add commentKarl Williamson2014-02-131-1/+3
|
* [perl #121207] test.pl tempfile() improvementsTony Cook2014-02-132-3/+58
|\
| * Make sure that tempfile() in t/test.pl removes the temp filesBrad Gilbert2014-02-131-0/+15
| | | | | | | | | | 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.
| * Add register_tempfile() to t/test.plBrad Gilbert2014-02-132-1/+26
| | | | | | | | | | | | | | | | 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.
| * Test that tempfile() in t/test.pl skips files that already existBrad Gilbert2014-02-131-1/+12
| |
| * Improve error diagnostics in t/test_pl/tempfile.tBrad Gilbert2014-02-131-2/+6
|/ | | | Tony: add a missing local
* Replace 'mkpath' (legacy interface) with 'make_path'.Alan Haggai Alavi2014-02-133-2/+4
| | | | | Update email of Alan Haggai Alavi; consolidate all email addresses in Porting/checkAUTHORS.pl.
* NETWARE CopFILE_setnReini Urban2014-02-131-1/+1
| | | | broken since 5.8.9
* pod/perldebguts: Stress ephemeral nature of regnode typesKarl Williamson2014-02-121-1/+1
|
* regcomp.h: Rmv false commentsKarl Williamson2014-02-121-4/+4
| | | | I misread the code when I added these comments
* regexec.c, locale.c: Silence some compiler warningsKarl Williamson2014-02-122-1/+3
| | | | | | | | | | | | 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
* Update CGI to CPAN version 3.65Chris 'BinGOs' Williams2014-02-122-2/+2
| | | | | | | | | | [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)
* acknowledgements: use $^X when running sub-perlRicardo Signes2014-02-101-1/+1
|
* tweak Porting/acknowledgements.pl to avoid awk and grepRicardo Signes2014-02-101-1/+3
| | | | | | | 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!
* provide a more limited change-count for acknowledgements.plGavin Shelley2014-02-102-1/+16
|
* Add some examples to cv_set_call_checker and wrap_op_checkerMatthew Horsfall2014-02-111-2/+17
|
* Update IO-Socket-IP to CPAN version 0.28Chris 'BinGOs' Williams2014-02-1010-12/+30
| | | | | | | | | | | | | | [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)
* Add IO-Socket-IP to Maintainers.plChris 'BinGOs' Williams2014-02-101-0/+8
|
* pp_concat: Only call SvPV_force_nolen when neededSteffen Mueller2014-02-101-4/+6
| | | | | | | | | 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?
* Update Module-Build to CPAN version 0.4205Chris 'BinGOs' Williams2014-02-0926-63/+80
| | | | | | | | | | | | | | | | [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]
* Update Pod-Escapes to CPAN version 1.05Chris 'BinGOs' Williams2014-02-092-22/+27
| | | | | | | | | | | | | | | [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
* Use ‘an’ for $/=[] error messageFather Chrysostomos2014-02-093-10/+14
| | | | | | | | | | | | | | 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’.
* Increase $mro::VERSION to 1.15Father Chrysostomos2014-02-091-1/+1
|
* Use HEKfARG in mro.xsFather Chrysostomos2014-02-091-10/+13
| | | | | It’s faster to pass the HEK directly instead of creating and throwing away SVs.
* [perl #120374] Stop for($h{k}||'') from vivifyingFather Chrysostomos2014-02-092-4/+36
| | | | | | | | | | | | | | | | | | 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).
* Remove DREFed flag from Concise.pmFather Chrysostomos2014-02-091-1/+0
| | | | | 0824d667 added the flag. 9026059dcee8 removed the flag but left it in B::Concise.
* Increase $B::Concise::VERSION to 0.992Father Chrysostomos2014-02-091-1/+1
|
* Expand tabs in diagnostics.pmFather Chrysostomos2014-02-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* diagnostics.pm: Eliminate $WHOAMIFather Chrysostomos2014-02-081-5/+6
| | | | | | | | 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).
* Increase $diagnostics::VERSION to 1.34Father Chrysostomos2014-02-081-1/+1
|
* perldiag: Wrap long linesFather Chrysostomos2014-02-081-7/+9
| | | | | | | | | 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.
* perldiag: Don’t use dev version numbersFather Chrysostomos2014-02-081-8/+8
| | | | Dev versions are an artefact of the developement process.
* perldiag: Consistent spaces after dotsFather Chrysostomos2014-02-081-8/+8
| | | | Also, non-integer should be hyphenated.
* Another perldelta typoFather Chrysostomos2014-02-081-1/+1
|
* Alphabetise perldiagFather Chrysostomos2014-02-081-37/+37
|
* perldelta typoFather Chrysostomos2014-02-081-1/+1
|
* [MERGE] fix and refactor re_intuit_start()David Mitchell2014-02-0810-395/+542
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * re_intuit_start(): add comments about check_ixDavid Mitchell2014-02-081-3/+3
| | | | | | | | | | | | if (check_ix) isn't very clear, so clarify it a bit.