summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* utf8_heavy: Skip unnecessary operationsKarl Williamson2012-01-131-2/+9
| | | | | | | | | The mktables generated tables are well-formed, already sorted, and with no extra items such as "+utf8::foo". Thus we don't have to do these operations on them, but they are required on user-defined properties, and should $list be passed in as a parameter. This patch moves the code that does this to just the user-defined area
* uni/class.t: Add testKarl Williamson2012-01-131-3/+6
| | | | | This new test makes sure that a regular expression that forward references a user-defined property works.
* utf8_heavy: remove unused variableKarl Williamson2012-01-131-3/+0
|
* Comment additions, typos, white-space.Karl Williamson2012-01-135-56/+70
| | | | And the reordering for clarity of one test
* regexec.c: Add some comments to regclass_swash()Karl Williamson2012-01-131-1/+16
|
* regexec.c: Remove unnecessary intermediate valuesKarl Williamson2012-01-131-7/+6
|
* un-break blead-breakage introduced by Porting/perl5160delta.podRicardo Signes2012-01-132-1/+2
|
* create perl5160delta-to-beRicardo Signes2012-01-131-0/+401
| | | | | | | | | | | This way, we can begin summarizing now, rather than summarize everything during the final release period. Also, note the new "Future Deprecations" section, in which we can, where possible, announce that we feel likely to formally deprecate things in the next major release.
* In Perl_sv_del_backref(), don't panic if svp is NULL during global destruction.Nicholas Clark2012-01-131-3/+12
| | | | | | | | It's possible that the referencing SV is being freed partway through the freeing of reference target. If this happens, the backreferences array of the target has already been freed, and so svp will be NULL. If this is the case, do nothing and return. Previously, this condition was not recognised and the code would panic.
* In Perl_sv_del_backref(), don't panic if the backref array is already freed.Nicholas Clark2012-01-131-0/+3
| | | | | | | | | | During global destruction, it's possible for the array containing backreferences to be freed before the SV that owns it. If this happens, don't mistake it for a scalar backreference stored directly, and then get confused and panic because things seem inconsistent. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-12/msg00039.html gives more information.
* Better panic diagnostics in Perl_sv_del_backref()Nicholas Clark2012-01-131-2/+3
| | | | | | If panicing with a croak(), include in the panic message the values which caused the croak. This reveals something about the cause of the panic, and more subtly, which of the two possible panic locations this is.
* Make -T HANDLE set the last stat typeFather Chrysostomos2012-01-122-1/+12
| | | | This was brought up in bug #77388.
* Simplify logic in pp_sys.c:pp_ftttyFather Chrysostomos2012-01-121-7/+2
| | | | | name is only set when there is no gv. As of a couple of commits ago, tmpsv is only used in that else block where it is set.
* [perl #77388] Make stacked -T and -B workFather Chrysostomos2012-01-122-1/+3
| | | | | | They just need to pick up the _ filehandle in stacked mode, like the other ops (which actually rely on my_stat[_flags] to do it). This apparently was forgotten when stacked filetests were added.
* Make -t, -T and -B with a handle pop it off the stackFather Chrysostomos2012-01-122-7/+9
| | | | | | This is something I broke carelessly with commit 094a3eec8. No, this does not fix bug #77388.
* In pp_sys.c:pp_fttext, don’t call cGVOP_gv on an UNOPFather Chrysostomos2012-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | Otherwise we might get a crash. cGVOP_gv is only valid when the OPf_REF flag is set. In either case, gv already holds the GV we want anyway. This code has been buggy this way since this commit: commit 5f05dabc4054964aa3b10f44f8468547f051cdf8 Author: Perl 5 Porters <perl5-porters@africa.nicoh.com> Date: Thu Dec 19 16:44:00 1996 +1200 [inseparable changes from patch from perl5.003_11 to perl5.003_12] but apparently has not actually caused a crash until just now. I was trying to add a test for another bug (fixed in the next commit), and it happened to trigger this one. My attempt to reduce this to something small and reproducible failed.
* [perl #24237] @& should not stop $& from workingFather Chrysostomos2012-01-102-5/+18
| | | | | | | | | | | | | | | | | Mentioning $& in a program slows everything down, because it force regular expressions to do a pre-match copy. It used to happen for any symbol named &, e.g., @& and %&. This was changed in commit b4a9608f339, but that commit did not take into account that the code path in question is only followed on creation of the *& glob. It should still be applying magic to $&, even if it is not setting PL_sawampersand. The other place in gv_fetchpvn_flags that magical- ises scalars (which currently handles %- %+ %! $] and @ISA), should also turn on PL_sawampersand for $&. All of the above applies to $' and $` as well.
* update the schedule: rjbs will do 5.16Ricardo Signes2012-01-101-4/+4
|
* [perl #35865, #43011] FETCH after autovivifyingFather Chrysostomos2012-01-103-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After autovivification, perl should not assume that the value it has assigned to a magical scalar is the one that would have been returned. The result of this assumption is that any tie class that copies things assigned to it will cause autovivification to assign to a temporary aggregate without warning, in cases like this: $tied{nonexistent}{foo} = 7; The hash implicitly assigned to $tied{nonexistent} ends up being freed after the =7 assignment. This commit changes autovivification to do FETCH immediately after doing STORE. This required changing some recently-added tests in gmagic.t. Without this change, you end up with horrific workarounds (using B.pm to get the reference count), like the one in JE::Object (which I’m pasting here, in case it has changed by the time you read this): sub STORE { my($self, $key, $val) = @_; my $global = $self->global; if(ref $val eq 'HASH' && !blessed $val && !%$val && svref_2object($val)->REFCNT == 2) { $val = tie %$val, __PACKAGE__, __PACKAGE__->new( $global); } elsif (ref $val eq 'ARRAY' && !blessed $val && !@$val && svref_2object($val)->REFCNT == 2) { require JE::Object::Array; $val = tie @$val, 'JE::Object::Array', JE::Object::Array->new($global); } $self->prop($key => $global->upgrade($val)) }
* Correct bad wording in perlsubFather Chrysostomos2012-01-091-1/+1
| | | | | | | It seemed to imply that CORE:: syntax was introduced in 5.16. What it was supposed to say was that CORE:: breaking through the feature.pm barrier was introduced in 5.16. (Which sounds a little odd, as 5.16 is still in the future, but whatever.)
* Fix crash in hv_undefFather Chrysostomos2012-01-091-8/+9
| | | | | | | Commit 60edcf09a was supposed to make things less buggy, but putting the ENTER/LEAVE in h_freeentries was a mistake, as both hv_undef and hv_clear still access the hv after calling h_freeentries. Why it didn’t crash for me is anyone’s guess.
* [perl #40333] Another testJoshua ben Jore2012-01-091-1/+13
| | | | | This test includes an explosive class, that overload::Overloaded should be able to handle.
* [perl #40333] Stop overload::Overloaded from calling ->canFather Chrysostomos2012-01-092-2/+25
| | | | | | | | | | | | | | It’s possible, and too easy, for classes to define a can method to deal with AUTOLOAD, without taking overloading into account. Since AUTOLOAD is the main reason for overriding can, and since overloading does not respect autoloading, can overrides should not be expected to deal with it. Since overload.pm already has a mycan function that fits this purpose, this commit changes Overloaded to use that. The test includes an example of a class structure that the previous Overloaded implementation could not handle.
* Document that [ah]v_undef/clear may free the [ah]vFather Chrysostomos2012-01-092-5/+17
|
* Better fix for perl #107440Father Chrysostomos2012-01-094-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > Actually, the simplest solution seem to be to put the av or hv on > > the mortals stack in pp_aassign and pp_undef, rather than in > > [ah]v_undef/clear. > > This makes me nervous. The tmps stack is typically cleared only on > statement boundaries, so we run the risks of > > * user-visible delaying of freeing elements; > * large tmps stack growth might be possible with > certain types of loop that repeatedly assign to an array without > freeing tmps (eg map? I think I fixed most map/grep tmps leakage > a > while back, but there may still be some edge cases). > > Surely an ENTER/SAVEFREESV/LEAVE inside pp_aassign is just as > efficient, > without any attendant risks? > > Also, although pp_aassign and pp_undef are now fixed, the > [ah]v_undef/clear functions aren't, and they're part of the public API > that can be called independently of pp_aassign etc. Ideally they > should > be fixed (so they don't crash in mid-loop), and their documentation > updated to point out that on return, their AV/HV arg may have been > freed. This commit takes care of the first part; it changes pp_aassign to use ENTER/SAVEFREESV/LEAVE and adds the same to h_freeentries (called both by hv_undef and hv_clear), av_undef and av_clear. It effectively reverts the C code part of 9f71cfe6ef2.
* Remove TODO functionality from assignwarn.tFather Chrysostomos2012-01-091-8/+4
|
* [perl #44895] += warning on uninit magic varFather Chrysostomos2012-01-093-6/+5
| | | | | | | | | | | | | | The only uses of USE_LEFT in core now occur when SvGETMAGIC has already been called. So returning true for magical SVs is not neces- sary. In fact, it was never correct. Also, the code in do_vop (which handles bitwise operations on strings) to avoid an uninitialized warning had the same buggy SvGMAGICAL check. Now, the warning from $uninit += 1 is suppressed for all undefined vars, not just amagical ones. This causes 6 to-do tests in assignwarn.t to pass.
* Remove magical dPOPXnnrl_ul dPOPXiirl_ul macrosFather Chrysostomos2012-01-091-12/+0
| | | | | | These are undocumented and unused on CPAN and in the core. The core now uses _nomg variants.
* Merge the POSIX notes in perldelta.Chris 'BinGOs' Williams2012-01-091-10/+6
|
* missed in prev commitH.Merijn Brand2012-01-091-2/+8
|
* 'A' is not blankH.Merijn Brand2012-01-091-2/+2
|
* Add probe for isblank() (requested by khw)H.Merijn Brand2012-01-0919-6/+58
|
* Test for perl #43663Father Chrysostomos2012-01-091-1/+9
|
* [perl #92254, #92256] Fix SAVE_DEFSV to do refcountingFather Chrysostomos2012-01-084-8/+28
| | | | | | | | | | | | | | | | The current definition of SAVE_DEFSV doesn’t take reference count- ing into account. Every instance of it in the perl core is buggy as a result. Most are also followed by DEFSV_set, which is likewise buggy. This commit implements SAVE_DEFSV in terms of save_gp and SAVEGENERICSV if PERL_CORE is defined. save_gp and SAVEGENERICSV are what local(*_) = \$foo uses. Changing the definition for XS code is probably too risky this close to 5.16. It should probably be changed later, though. DEFSV_set is now changed to do reference counting too.
* grep.t: require test.pl in BEGIN blockFather Chrysostomos2012-01-081-1/+1
| | | | for parenthetical omissions.
* need backwards-compatile to_utf8_foo()Karl Williamson2012-01-084-12/+57
| | | | | | | | | | These 4 functions have been replaced by variants to_utf8_foo_flags(), but for XS code that called the old ones in the Perl_to_utf8_foo() forms, backwards compatibility versions need to be created. For calls of just the to_utf8_foo() forms, macros have been used to automatically call the new forms without the performance penalty of going through the compatibility functions.
* embed.fnc: Revise commentKarl Williamson2012-01-081-1/+1
| | | | | The 'd' flag doesn't mean that the documentation has to be even in the same file as the source for that function; just somewhere in the source.
* embed.fnc: add commentKarl Williamson2012-01-081-1/+2
|
* Update perlfaq to CPAN version 5.0150037Chris 'BinGOs' Williams2012-01-0812-469/+182
| | | | | | | | | | | [DELTA] 5.0150037 Sun 8 Jan 2012 21:24:39 +0100 * Better XML parsing recommendations (apeiron) * Remove various old questions & update a few (ranguard) * Change auto generate of questions a bit (ranguard) * Autogenerate question index in perlfaq.pod (doherty) * Cleanups / typos, updating nested expressions (dami, reviewed by schwern)
* [perl #67490] Don’t call DELETE on scalar-tied elemFather Chrysostomos2012-01-082-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This little snippet: sub TIESCALAR{bless[]} sub STORE{} tie $^H{foo}, ''; $^H{foo} = 1; delete $^H{foo}; dies with ‘Can't locate object method "DELETE"...’. This bug was introduced for %^H by commit b3ca2e834c, but it is actu- ally an older bug that already affected %ENV before that. Clear-magic on a scalar is only called when it is an element of a mag- ical aggregate. For hashes, this clear-magic is called whenever the hash itself is RMAGICAL. Tied scalars and elements of tied aggregates use the same magic vta- ble, under the assumption that mg_clear will never be called on a tied scalar. That assumption is wrong. Commit b3ca2e834c is the one that made %^H magical, which is why it caused this problem for %^H. The obvious solution, giving tied scalars their own vtable, is not as simple as it sounds, because then tied scalars are no longer RMAGICAL, and at least some of the tie code assumes that they are. So the easiest fix is to skip the DELETE call in Perl_magic_clearpack if the type of magic is PERL_MAGIC_tiedscalar.
* Simplify magic logic in av.c:av_storeFather Chrysostomos2012-01-081-2/+1
|
* clarify how $SIG{__DIE__} can returnDavid Mitchell2012-01-081-4/+4
| | | | | | | It can return via 'goto &sub', but not via 'goto LABEL'. The docs originally just said 'via goto' See [perl #44367].
* perlfunc: spaces after dotsFather Chrysostomos2012-01-071-4/+4
|
* Make localtime()' s documentation more succinctTom Hukins2012-01-071-6/+2
| | | | | It's now twelve years since Y2K, so the documentation should not make such a fuss about it.
* [perl #85670] Copy magic to ary elems properlyFather Chrysostomos2012-01-062-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Tue Mar 08 07:26:35 2011, thospel wrote: > #!/usr/bin/perl -l > use Data::Dumper; > use Scalar::Util qw(weaken); > our @ISA; > > for (1..2) { > @ISA = qw(Foo); > weaken($a = \@ISA); > weaken($a = \$ISA[0]); > print STDERR Dumper(\@ISA); > } > > This prints: > $VAR1 = [ > 'Foo' > ]; > $VAR1 = [ > 'Foo', > \$VAR1->[0] > ]; > > So the first time it's the expected @ISA, but the second time round it > automagically added a reference to to the first ISA element > > (bug also exists in blead) Shorter: #!/usr/bin/perl -l use Scalar::Util qw(weaken); weaken($a = \@ISA); @ISA = qw(Foo); use Devel::Peek; Dump \@ISA; weaken($a = \$ISA[0]); print scalar @ISA; # prints 2 The dump shows the problem. backref magic is being copied to the ele- ment. Put the magic in a different order, and everything is fine: #!/usr/bin/perl -l use Scalar::Util qw(weaken); weaken($a = $b = []); *ISA = $a; @ISA = qw(Foo); use Devel::Peek; Dump \@ISA; weaken($a = \$ISA[0]); print scalar @ISA; # prints 2 This code in av_store is so wrong: if (SvSMAGICAL(av)) { const MAGIC* const mg = SvMAGIC(av); if (val != &PL_sv_undef) { sv_magic(val, MUTABLE_SV(av), toLOWER(mg->mg_type), 0, key); } if (PL_delaymagic && mg->mg_type == PERL_MAGIC_isa) PL_delaymagic |= DM_ARRAY_ISA; else mg_set(MUTABLE_SV(av)); } It doesn’t follow the magic chain at all. So anything magic could get attached to the @ISA array, and that will be copied to the element instead of isa magic. Notice that MUTABLE_SV(av) is the second argument to sv_magic, so mg->mg_obj for the element always points back to the array. Since backref magic’s mg->mg_obj points to the backrefs array, @ISA ends up being used as this element’s backrefs array. What if arylen_p gets copied instead? Let’s see: $#ISA = -1; @ISA = qw(Foo); $ISA[0] = "Bar"; main->ber; sub Bar::ber { warn "shave" } __END__ Can't locate object method "ber" via package "main" at - line 7. I’ve fixed this by making av_store walk the magic chain, copying any magic for which toLOWER(mg->mg_type) != mg->mg_type.
* [perl #107440] Save av/hv on mortals stack when clearingFather Chrysostomos2012-01-064-8/+25
| | | | | | | | | | | | | | | | | | | In pp_undef and pp_aassign, we should put the av or hv that is being cleared on the mortals stack (with an increased refcount), so that destructors fired during the clearing do not free the av or hv. I was going to put this in av_undef, etc., but pp_aassign also needs to access the aggregate after clearing it. We still get a crash with that approach. Putting the aggregate on the mortals stack in av_undef, av_clear and h_freeentries would work, too, but might cause the aggregate to leak too far. That may cause problems, e.g., if it is %^H, because it may last until the end of the current compilation unit. Directly inside a runloop (in a pp function), it should be OK to use the mortals stack, as it *will* be cleared ‘soon’. This seems the least intrusive approach.
* [perl #90632] perlfunc: Rewrite `split'Michael Witten2012-01-061-80/+114
| | | | | | | | | | | | | | | | | | | | | I couldn't stand the way the documenation for `split' was written; it felt like a kludge of broken English dumped into a messy pile by several people, each of whom was unaware of the other's work. This variation completes sentences, adds new ones, rearranges ideas, expands on ideas, simplifies and unifies examples, and includes more cross references. While the original text seemed to be written in a way that touched upon the arguments in reverse order (which did have a hint of elegance), this version attempts to provide the reader with the most useful information upfront. Thanks to Brad Baxter and Thomas R. Sibley for their constructive criticism. [Modified by the committer to incorporate suggestions from Aristotle Pagaltzis and Tom Christiansen.]
* document the upgrade of PerldocRicardo Signes2012-01-062-2/+7
|
* Pod-Perldoc now includes test documentsRicardo Signes2012-01-061-0/+4
| | | | do not test them as if they were Pod we ship
* Upgrade Pod-Perldoc to CPAN version 3.15_15Ricardo Signes2012-01-0626-909/+9814
|