summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* add releaase 5.17.2 to perlhistv5.17.2Tony Cook2012-07-201-1/+3
|
* update Module::CoreList for 5.17.2Tony Cook2012-07-204-4/+695
|
* Porting/corelist.pl didn't handle newlines in the pod version listTony Cook2012-07-201-1/+1
|
* finalize perldeltaTony Cook2012-07-201-232/+35
|
* Only generate above-Uni warning for \p{}, \P{}Karl Williamson2012-07-197-40/+568
| | | | | | | | | | | This warning was being generated inappropriately during some internal operations, such as parsing a program; spotted by Tom Christiansen. The solution is to move the check for this situation out of the common code, and into the code where just \p{} and \P{} are handled. As mentioned in the commit's perldelta, there remains a bug [perl #114148], where no warning gets generated when it should
* regcomp.c: Refactor code into a functionKarl Williamson2012-07-194-10/+40
| | | | | | Future commits will use this functionality in additional places beyond the single one currently. It makes sense to abstract it into a function.
* regcomp.c: set local flag in pass1 of charclass inversionKarl Williamson2012-07-191-5/+8
| | | | | | | Previously, this flag was not looked at in pass 1, but future commits will require it to be. The regnode is not actually allocated in pass1, so set a local variable with the value, and set the flag in the regnode after everything affecting the flag is done.
* regcomp.c: Keep separate list for [:word:] from \p{Word}Karl Williamson2012-07-191-47/+61
| | | | | | This commit separates out the building up of code points that match the posix properties (including \w, \d, \s) from those that match Unicode properties. This will prove useful in future commits
* regcomp.c: Convert boolean variable from a UVKarl Williamson2012-07-191-2/+2
| | | | It's a little clearer to use boolean for a true/false valued variable
* utf8.c: Create API so internals can be hiddenKarl Williamson2012-07-195-7/+23
| | | | | | | This creates a function to hide some of the internal details of swashes from the regex engine, which is the only authorized user, enforced through #ifdefs in embed.fnc. These work closely together, but it's best to have a clean interface.
* regcomp.h: Free up bit; downside is makes locale ANYOF nodes largeKarl Williamson2012-07-192-22/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There have been two flavors of ANYOF nodes under /l (locale) (for bracketed character classes). If a class didn't try to match things like [:word:], it was smaller by 4 bytes than one that did. A flag bit was used to indicate which size it was. By making all such nodes the larger size, whether needed or not, that bit can be freed to be used for other purposes. This only affects ANYOF nodes compiled under locale rules. The hope is to eventually git rid of these nodes anyway, by taking the suggestion of Yves Orton to compile regular expressions using the current locale, and automatically recompile the next time they are used after the locale changes. This commit is somewhat experimental, done early in the development cycle to see if there are any breakages. There are other ways to free up a bit, as explained in the comments. Best would be to split off nodes that match everything outside Latin1, freeing up the ANYOF_UNICODE_ALL bit. However, there currently would need to be two flavors of this, one also for ANYOFV. I'm currently working to eliminate the need for ANYOFV nodes (which aren't sufficient, [perl #89774]), so it's easiest to wait for this work to be done before doing the split, after which we can revert this change in order to gain back the space, but in the meantime, this will have had the opportunity to smoke out issues that I would like to know about.
* regcomp.h: Fix up commentKarl Williamson2012-07-191-2/+2
|
* regcomp.c: Clarify, update comments, white-space reflowKarl Williamson2012-07-191-6/+10
|
* perlapi: Clarify hv_fetch() docsKarl Williamson2012-07-191-1/+4
| | | | | I was confused by the earlier documentation. Thanks to Leon Timmermans for clarifying, and to Vicent Pitt for most of the wording
* op/join.t: don't use done_testingDavid Mitchell2012-07-191-1/+2
| | | | since the number of tests is known in advance.
* Fixup indentationJan Dubois2012-07-181-6/+9
|
* Adding support for Visual C's __declspec(noreturn) function declarations to perlDaniel Dragan2012-07-184-14/+27
| | | | | | | | | This will reduce the machine code size on Visual C Perl, by removing C stack clean up opcodes and possible jmp opcodes after croak() and similar functions. Perl's existing __attribute__noreturn__ macro (and therefore GCC's __attribute__((noreturn)) ) is fundamentally incompatible with MS's implementation for noreturn functions. win32.h already has _MSC_VER aware code blocks, so adding more isn't a problem.
* perldelta updatesTony Cook2012-07-181-0/+18
|
* sync() on a read-only file handle doesn't work on cygwin eitherTony Cook2012-07-171-1/+4
| | | | | Cygwin fsync() is implemented in terms of the Win32 FlushFileBuffers() API which requires GENERIC_WRITE access.
* perldelta description of magic flags patchChip Salzenberg2012-07-151-0/+9
|
* mark blead-only modifications of Compress::Raw::{Bzip2,Zlib} with version bumpChip Salzenberg2012-07-152-2/+2
|
* Magic flags harmonization.Chip Salzenberg2012-07-1519-538/+486
| | | | | | | | | | | | | | | | | | | | | | | | | In restore_magic(), which is called after any magic processing, all of the public OK flags have been shifted into the private OK flags. Thus the lack of an appropriate public OK flags was used to trigger both get magic and required conversions. This scheme did not cover ROK, however, so all properly written code had to make sure mg_get was called the right number of times anyway. Meanwhile the private OK flags gained a second purpose of marking converted but non-authoritative values (e.g. the IV conversion of an NV), and the inadequate flag shift mechanic broke this in some cases. This patch removes the shift mechanic for magic flags, thus exposing (and fixing) some improper usage of magic SVs in which mg_get() was not called correctly. It also has the side effect of making magic get functions specifically set their SVs to undef if that is desired, as the new behavior of empty get functions is to leave the value unchanged. This is a feature, as now get magic that does not modify its value, e.g. tainting, does not have to be special cased. The changes to cpan/ here are only temporary, for development only, to keep blead working until upstream applies them (or something like them). Thanks to Rik and Father C for review input.
* perldelta updatesFather Chrysostomos2012-07-141-0/+27
|
* dump.c: Dump op->op_s(labbed|avefree)Father Chrysostomos2012-07-141-1/+3
|
* Remove op_latefree(d)Father Chrysostomos2012-07-144-150/+4
| | | | | | | This was an early attempt to fix leaking of ops after syntax errors, disabled because it was deemed to fragile. The new slab allocator (8be227a) has solved this problem another way, so latefree(d) no longer serves any purpose.
* perly.y: Remove use of latefree from package foo {}Father Chrysostomos2012-07-144-201/+183
| | | | | | | | It is not necessary for the op containing the sv containing the name of the package to last until the end of the block. Perl_package can free the op immediately, as the only information it needs from it it copies to the sv in PL_curstname. The version number can be treated the same way.
* op.c: ck_grep does not need to call listkidsFather Chrysostomos2012-07-141-1/+1
| | | | | It calls ck_fun, which applies list context to all the arguments, since grepstart and mapstart have an L in regen/opcodes.
* op.c: ck_fun does not need to call LINKLISTFather Chrysostomos2012-07-141-1/+0
| | | | | The branch in question is only reached when it is called from ck_grep, which itself calls LINKLIST on exactly the same op.
* op.c:ck_grep: Remove unnecessary op_next assignmentsFather Chrysostomos2012-07-141-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ck_grep is a tangled mess and I am trying to simplify it, but at each step it is not at all obvious what is happening. grep/map with a block starts out like this: grepstart pushmark null scope/leave block contents... arg1 arg2 ... The if (o->op_flags & OPf_STACKED) at the top of ck_grep runs for blocks. The firstkid var refers to the null above, and gets its op_next set (this code was in ck_sort until recently [ck_grep used to call ck_sort], and this particular op_next assignment was specific to grep and map). Later, the thing is fed through ck_fun, whose OA_CVREF case transforms the tree into this: grepstart pushmark null ← new op null ← original null scope/leave block contents... arg1 arg2 ... Then cUNOPx(cLISTOP->op_first->op_sibling)->op_first gets its op_next set. By that point, that expression refers to the original null op, so setting its op_next pointer to begin with seems pointless. But it is not actually pointless. Removing that statement breaks things. It turns out, as usual, that everything is more complicated than it seems. Setting kid->op_next = (OP*)gwop in the block-specific if statement after setting the first null op’s op_next pointer results in op_next pointers like this (the newly-created grepwhile doesn’t link to the grepstart yet at this point): [grepwhile] grepstart pushmark null -> block contents scope/leave -> grepwhile block contents... arg1 arg2 ... So ck_fun’s OA_CVREF handling, when it calls LINKLIST, sees that the original null op already has its op_next set and does nothing. With- out it set, it copies it from the first kid, resulting in this (when LINKLIST copies the op_next pointer out, it makes the kid it was cop- ied from point to its sibling or its parent): [grepwhile] grepstart pushmark null null -> grepwhile scope/leave -> null (prev line) block contents... arg1 arg2 ... That nonsensical arrangement of op_next pointers basically prevents the block from running, because the grepwhile’s other pointer, copied from the first null’s kid, ends up pointing to the grepwhile itself. If we also remove the kid->op_next = (OP*)gwop assignment from the if(OPf_STACKED) block, then we end up with this after ck_fun: [grepwhile] grepstart pushmark null null -> first op in block scope/leave -> null (prev line) block contents... arg1 arg2 ... Then the op_next poiner from the first null’s kid is copied to grepwhile’s op_other pointer, and everything works. This also means we can remove the now-redundant LINKLIST call from the if(OPfSTACKED) block, since ck_fun’s OA_CVREF handling also does that. So now every vestige of the original call to ck_sort is gone. This also means we no longer have to repeat NewOp(1101, gwop...).
* op.c: ck_grep does not need to check num of argsFather Chrysostomos2012-07-141-2/+0
| | | | | It calls ck_fun first, which does the same check, so it is unnecessary.
* pp_hot.c: Mention that pp_grepstart calls pp_pushmarkFather Chrysostomos2012-07-141-1/+1
|
* Simplify ck_grepFather Chrysostomos2012-07-144-30/+22
| | | | | | | | | | | | | | | | | | Back in perl 5.000, ck_grep would call ck_sort (which was still the case until 354dd559d99 just recently) and the latter would traverse its way through the op_next pointers to find an op that tried to escape the block, setting its op_next pointer to null. Then ck_grep would traverse op_next pointers itself to find the place where ck_sort stopped. That caused problems for grep which were fixed in 748a93069b (perl 5.001). It was fixed by setting op_next to 0 on the first op, so that the loop in ck_grep would not do anything. But that loop was left there. This commit removes it. There are also a couple of things I missed when disentangling ck_grep and ck_sort in commit /354dd559d9. I accidentally put if (o->op_flags & OPf_STACKED) inside if (o->op_flags & OPf_STACKED). And the OPf_SPECIAL flag was only being set for sort’s use, so ck_grep doesn’t need to copy that.
* op.c: Further simplify ck_sortFather Chrysostomos2012-07-141-18/+3
| | | | | | | | | | | | | | This code currently chases op_next pointers in the sort block to make sure there is none that can point outside. To avoid getting stuck in loops, it has to check for those explicitly. Instead of nulling out any op_next pointer that points to the leave op, we can simply turn the leave into a null op (which we already do) and have the leave op’s op_next pointer point to nothing. That produces the same result in the end: Execution of the sort block is prevented from running rampant and escaping out of it, but exits the runloop instead, returning control to pp_sort.
* Upgrade Socket to 2.002Tony Cook2012-07-147-23/+158
|
* op.c: Consistent tweak; podchecker complaintsFather Chrysostomos2012-07-141-4/+5
|
* Update perlop's bignum modules list.Shlomi Fish2012-07-141-3/+4
| | | | | Removed some out-of-date modules and add Math::GMPq, Math::GMPz and Math:GMPf.
* op.c: Missing line breakFather Chrysostomos2012-07-141-1/+2
|
* Disentangle ck_sort and grepFather Chrysostomos2012-07-141-24/+16
| | | | | | | | | Originally, sort and grep/map used the same code for handling the block’s ops. But that didn’t quite work, so exceptions were added over time. Now the thing is a complex sprawling mess. By folding the grep-specific code into ck_grep, things are greatly simplified.
* [perl #113710] Make __SUB__ work in sort blockFather Chrysostomos2012-07-144-18/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the peephole optimiser encounters a __SUB__, it looks to see whether the current sub is clonable. If it is not, it inlines the __SUB__ as a const op. This works most of the time. A forward declaration will cause the sub definition to reuse the existing stub. When that happens, the sub visible during compilation in PL_compcv is not the sub that the op tree will finally be attached to. But the peephole optimiser is called after that, with PL_compcv set to the other CV (what was a stub). ck_sort was calling the peephole optimiser on the sort block ahead of time. So this caused __SUB__ to point to the wrong subroutine. By removing the CALL_PEEP call from ck_sort and adding logic to the peephole optimiser itself to traverse the sort block (it is not in the usual op_next chain), this bug is eliminated. I modified the DEFER macro to work as a single statement. You don’t want to know how much time I spent debugging the bus errors that were occurring because if(foo) DEFER; didn’t do what I though. It turns out that grepstart and mapstart, which also use ck_sort, had their blocks go through the peephole optimiser twice, because grepwhile already has special-casing in the peephole optimiser. This also has the side-effect of making map and grep slightly more efficient, in that they no longer execute a scope op (which is just pp_null). By temporarily disconnecting the subtree before running the optimiser, ck_sort was hiding a possible optimisation (skipping the scope op).
* fix RT#114068 optimizer handles MEOL in middle of pattern improperlyYves Orton2012-07-132-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | It seems that under certain circumstances the optimiser handles the MEOL operator (what $ turns into under /m), improperly including things that follow. This results in compilation like this: Compiling REx "( [^z] $ [^z]+ )" Final program: 1: OPEN1 (3) 3: ANYOF[\x00-y{-\xff][{unicode}0100-INFINITY] (14) 14: MEOL (15) 15: PLUS (27) 16: ANYOF[\x00-y{-\xff][{unicode}0100-INFINITY] (0) 27: CLOSE1 (29) 29: END (0) anchored ""$ at 2 stclass ANYOF[\x00-y{-\xff][{unicode}0100-INFINITY] Where the '""$ at 2' is sign of the bug. The problem is that the optimiser does not "commit" the string when it encounters an MEOL, which means that text that follows it is included. This has probably always been wrong as $ is a multichar pattern (it matches before an \n or including an \n). This failure to commit then interacts with the implementation for PLUS leading to an incorrect offset. By adding a SCAN_COMMIT() as part of the optimisers handling of EOL constructs this problem is avoided. Note that most uses of $ were ok due to other reasons.
* [perl #113576] Restore err msg for &{+undef}Father Chrysostomos2012-07-133-4/+15
| | | | | | | | | | | | | | | | This ‘Can't use an undefined value as a subroutine reference’ message used to occur for &{+undef}, until commit 15ff848f77796 in 1997. Then it started happening only for magic variables. Non-magical variables would treat it the same as "", possibly dying with ‘Undefined subroutine main:: called’, and possibly calling the subroutine with that name. Magical variables (&{$tied_undef}) started behaving the same way (treating undef as "") with commit 7c75014e, in 2010. This commit restores that message.
* [perl #113470] Constant folding for packFather Chrysostomos2012-07-134-3/+20
| | | | | | | | | | | | | This takes the pessimistic approach of skipping it for any first argu- ment that is not a plain non-magical PV, just in case there is a 'p' or 'P' in the stringified form. Otherwise it scans the PV for 'p' or 'P' and skips the folding if either is present. Then it falls through to the usual op-filtering logic. I nearly made ‘pack;’ crash, so I added a test to bproto.t.
* [perl #113020] INSTALL: Clarify CPAN::autobundleFather Chrysostomos2012-07-131-2/+3
|
* silence override warningRobin Barker2012-07-131-1/+4
| | | | | The test is trying to test the behaviour being warned about, so the code is right but the warning can be suppressed.
* mro/basic.t: Squelch warningFather Chrysostomos2012-07-131-0/+1
|
* silence warning about use of --libpodsRobin Barker2012-07-131-1/+0
| | | | | --lipods warns, and I don't think it is needed in this test, so I have removed it
* silence compiler warning - casting void* to IVRobin Barker2012-07-131-1/+1
| | | | | This warns when void* and IV have different sizes There is already a macro to do this conversion cleanly: PTR2IV
* mg_vtable.pl: Mention all generated filesFather Chrysostomos2012-07-121-0/+2
|
* Fix @{*ISA} autovivificationFather Chrysostomos2012-07-122-1/+11
| | | | | It was not attaching magic to the array, preventing subsequent changes to the array from updating isa caches.
* Fix *ISA = *glob_without_arrayFather Chrysostomos2012-07-122-3/+14
| | | | | | | | | | I broke this in 5.14 with commit 6624142a. In trying to make *ISA = *Other::ISA work, I added logic to make @Other::ISA’s existing magic now point to *ISA’s stash. I skipped that logic if *Other::ISA did not contain an array. But in so doing, I inadvertently skipped the call to mro_isa_changed_in at the same time.