summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* regcomp.c: \x{17f} can match /\xdf/iKarl Williamson2011-05-191-0/+1
|
* fold_grind.t: remove unnecessary testsKarl Williamson2011-05-191-1/+5
| | | | | | This is supposed to test weird combinations of things. Tests like 'ss' =~ /SS/i aren't weird, and so can be skipped.
* fold_grind.t: No longer any TODOsKarl Williamson2011-05-191-9/+1
|
* Fix some multi-char /i fold bugsKarl Williamson2011-05-191-4/+147
| | | | | | | | | | | | | | | | | | | | | | Consider U+FB05 and U+FB06. These both fold to 'st', and hence should match each other under /i. However, Unicode doesn't furnish a rule for this, and Perl hasn't been smart enought to figure it out. The bug that shows up is in constructs like "\x{fb06}" =~ /[^\x{fb05}]/i succeeding. Most of these instances also have a 'S' entry in Unicode's CaseFolding.txt, which avoids the problem (as mktables was earlier changed to include those in the generated table). But there were several code points that didn't. This patch changes utf8.c to look for these when constructing it's inverted list of case fold equivalents. An alternative would have been to change mktables instead to look for them and create synthetic rules. But, this is more general in case the function ends up being used for other things. I will change fold_grind.t to test for these in a separate commit.
* utf8.c: Remove soon-to-be-obsoleted commentKarl Williamson2011-05-191-16/+0
| | | | | This comment will no longer apply, as the code it talked about is moving into swash_init().
* utf8_heavy: Return pointer to special treatment hash.Karl Williamson2011-05-191-0/+11
| | | | | | | | Many of the mapping tables that utf8_heavy.pl deals with have maps that don't fit into the general scheme of things, and a hash is generated for those. This patch causes utf8_heavy to add an entry to the object it generates containing a reference to this hash. Prior to this, the name of the hash had to be known to the users of the table.
* utf8_heavy: Add commentsKarl Williamson2011-05-191-0/+4
|
* mktables: Add info giving specials hash nameKarl Williamson2011-05-191-4/+16
| | | | | | mktables creates %utf8::SwashInfo in each table it generates, giving some info about the table. Add an entry to this for tables that have a hash of special mappings, giving the name of that hash.
* utf8_heavy.pl: Revise commentKarl Williamson2011-05-191-2/+1
|
* utf8.c: Remove unnecessary temporaryKarl Williamson2011-05-191-5/+2
|
* utf8.c: "<" should be "<="Karl Williamson2011-05-191-1/+1
| | | | | | | av_len() is misnamed, and hence led me earlier to stop the loop one shy of what it should have been. No actual bugs were caused by this, but it could cause a duplicate entry in an array, which is searched linearly, hence a slight slowdown.
* fold_grind.t: Refactor subtestsKarl Williamson2011-05-191-18/+33
| | | | | | | This causes run_test() to be part of the subtests, and makes a subtest for each pair of code points tested plus the character set. This results in fewer tests output, plus more information about what's happening
* PATCH: [perl #88822] Re: Test failure t/re_fold_grind.t with bleadperlKarl Williamson2011-05-191-1/+12
|
* regex: Add commentsKarl Williamson2011-05-193-5/+6
|
* fold_grind.t: Slightly change debug stmtKarl Williamson2011-05-191-2/+1
|
* fold_grind.t: Make sure special-cased code points are testedKarl Williamson2011-05-191-2/+4
|
* fold_grind.t: Add testing of multi-char folds in patternKarl Williamson2011-05-191-3/+6
| | | | | Previously these were skipped. Now skip just the ones that don't make sense or aren't implemented.
* regcomp.c: Add two tricky fold casesKarl Williamson2011-05-191-0/+4
| | | | | These two characters fold to lower-case characters that are involved in tricky folds, and hence these can be too.
* Revamp podcheck.tKarl Williamson2011-05-193-53/+1861
| | | | | | | | | | | This new podcheck.t catches more problems, and tests more pods than the current one, while suppressing some existing warnings that really aren't problems. It takes longer to execute. I have profiled it, and most of the increased time appears to be because of testing more pods. A complete pod for its usage is included
* improve api entries for hv_clear() and hv_undef()David Mitchell2011-05-191-2/+7
| | | | | | The =apidoc entries for hv_clear() and hv_undef() were a bit spartan. Make it clearer what the two functions actually do, and the relationship between them.
* ensure hash iterator gets deletedDavid Mitchell2011-05-192-7/+21
| | | | | | | | | The recent commits to make sv_clear() iterative when freeing a hash, introduced a bug. If the hash only has one key, and that becomes the iterator, and is then deleted; then when the hash is freed, the LAZYDEL feature is skipped, and the iterated hash value fails to get deleted. The fix is simple: check for LAZYDEL before return is keys == 0.
* assume cleared hv can't be re-blessedDavid Mitchell2011-05-191-5/+3
| | | | | | | | | | | | | | followup to previous commit. I'm fairly confident now that a HV being freed in sv_clear() can never get re-blessed, and thus its SvSTASH field is *always* safe to use. The logic behind this is that once you get to sv_clear(), the HV has a refcnt of zero, which means either: * nothing references this, so there's no way to bless it; * we're in SVf_BREAK territory, in which case something may still hold a reference to it, but all destructors will have already been called, so nothing can call bless.
* make hv freeing iterative rather than recursiveDavid Mitchell2011-05-192-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | make sv_clear() iteratively free the elements of a hash, rather than recursing. This stops freeing deeply nested hash of hash structures from blowing the stack. This commit is relatively straightfoward, now that a) the infrastruure is already in place in sv_clear to iteratively free AVs; b) the long sequence of commits leading up to this has provided us with the hfree_next_entry() function, which returns just the next sv in the hash that needs freeing. When starting to free a new hash, we have to save the old value of iter_sv somewhere; we do this by sticking it in the unused SvSTASH slot of the HV. This slot shouldn't get messed with, since, but this time we've already called the destructor on this object, and we should have a refcount of zero, so no destructor should be able to see us to rebless us. Ideally we'd like to be able to save the old index into HvARRAY when freeing a new HV, but I couldn't think of anywhere to hide it. So we get sub-optimal scanning of the parent's HvARRAY when freeing hashes of hashes.
* add hfree_next_entry(), hv_free_ent_ret()David Mitchell2011-05-194-54/+105
| | | | | | | | | | | | | Move body of hfreeentries()' central loop into a new function, hfree_next_entry(); leaving hfreeentries() as a simple loop that calls hfree_next_entry() until there are no entries left. This will in future allow sv_clear() to free a hash iteratively rather than recursively. Similarly, turn hv_free_ent() into a thin wrapper around a new function, hv_free_ent_ret(), which doesn't free HeVAL(), but rather just returns the SV instead.
* remove 'hfreeentries failed to free hash' panicDavid Mitchell2011-05-192-13/+1
| | | | | | | | | | | | | | | | | | | Currently perl attempts to clear a hash 100 times before panicking. So for example, if a naughty destructor keeps adding things back into the hash, this will eventually panic. Note that this can usually only occur with %h=() or undef(%h), since when freeing a hash, there's usually no reference to the hash that a destructor can use to mess with the hash. Remove this limit (so it may potentially loop forever). My reasoning is that (a) if the user wants to keep adding things back into the hash, who are we to stop her? (b) as part of of the process of making sv_clear() non-recursive when freeing hashes, I'm trying to reduce the amount of state that must be maintained between each iteration. Note that arrays currently don't have a limit.
* hv_free_ent: free SV as last actionDavid Mitchell2011-05-191-1/+1
| | | | | | | Move the freeing of the SV from near the beginning to the end of hv_free_ent(); i.e. free the HE before the SV. Ideally, this should cause no change in behaviour, but will make using an iterative HV freeing scheme easier.
* HV backrefs: another simplificationDavid Mitchell2011-05-191-2/+5
| | | | | Now that HV backrefs are only stored in HvAUX, don't go looking for them in magic too in sv_clear()
* assert that HvARRAY is NULL when freeing an HVDavid Mitchell2011-05-191-0/+1
| | | | | The code path that leads to HvAUX being empty and thus HvARRAY being freed, is non-obvious: so put in an assert against any future failure.
* S_hfreeentries: collapse two loopsDavid Mitchell2011-05-191-56/+48
| | | | | | | | | S_hfreeentries() has two nested infinite loops: the inner one does one sweep through all buckets, freeing all entries in each bucket; the outer loop repeats the process if new keys have been added in the meantime. Collapse these two into a single 'while (keys) {}' loop. Should be functionally the same, but simpler.
* hfreeentries zeros HvARRAY now, so skip manualDavid Mitchell2011-05-191-12/+1
| | | | | | | Formerly, hv_clear() and hv_undef() zeroed the contents of HvARRAY after calling hfreeentries(), but that sub now zeroes each elements as a by-product of its deleting algorithm. So we can skip the Zero().
* simplify HV backref codeDavid Mitchell2011-05-191-23/+6
| | | | | Now that HV backref data is always stored in HvAUX and never in magic, update the various backref handling functions to account for that.
* make hash emptying non-atomicDavid Mitchell2011-05-192-181/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when empting a hash of its elements (e.g. via undef(%h), or %h=()), HvARRAY field is temporarily zeroed, so that any destructors called on the freed elements see an empty hash. Change this so that they see any remaining elements. Thus, %h=() becomes more like C<delete $h{$_} for keys %h>. The atomic behaviour was introduced (by me) in 2003 with commit 2f86008e34264, to fix RT #3096. This concerned element destructors that messed with the hash being undeffed, causing unrefed var errors and the like. At the time, simply setting HvARRAY to null for the duration seemed like a simple fix. However, it didn't take account of destructors adding new elements to the list, thus re-creating HvARRAY. This was subsequently fixed. Then, the HvAUX structure was invented, which meant that optional hash fields were hidden away at the end of HvARRAY. This meant that hfreeentries() acquired a whole bunch of extra code to copy these fields around between the original HvARRAY and the new HvARRAY and then back again, and temporarily squirrelling the backref array in backref magic rather than in HvAUX. In short, hfreeentries() became a 200 line sprawling mess. This commit reduces it back to 70, and makes everything conceptually simpler. It does however change user-level visible behaviour (back to pre-2003), but note that the new behaviour now matches the behaviour that arrays have always had (i.e. destructors see a partially-emptied array). Note that backref magic for HVs is now always stored in HvAUX
* unify PERL_HASH and PERL_HASH_INTERNALDavid Mitchell2011-05-192-41/+25
| | | | | | | | | | | | | | | | | | Those two macros expand into two large, almost identical chunks of code. The only difference between the two is the source of the hash seed. So parameterize this into a new PERL_HASH_INTERNAL_() macro. Also, there are a couple of places in hv.c that do the rough equivalent of if (HvREHASH(hv)) key = PERL_HASH_INTERNAL(...) else key = PERL_HASH(...) which incorporates two complete macro expansions into the code. Reorganise them to be key = PERL_HASH_INTERNAL_(..., HvREHASH(hv))
* simplify hv_clearDavid Mitchell2011-05-191-11/+10
| | | | | | | | | | | | | | | | | | | | | | Don't use a goto when an else will do i.e. replace if (..) { A goto reset } B reset: with if (..) { A } else { B }
* Perl_ck_split: Avoid unnecessary assignmentMichael Witten2011-05-191-2/+3
| | | | Signed-off-by: Michael Witten <mfwitten@gmail.com>
* [perl #90594] PATCH for 5.14.1 perlop.podTom Christiansen2011-05-191-1/+7
|
* Increase t::OptreeCheck’s versionFather Chrysostomos2011-05-191-1/+1
| | | | | | cmp_version.t was complaining. Why does this even *have* a version?
* [perl #90306] Fix simple typosMarcel Grünauer2011-05-1918-21/+21
|
* Increase B::Concise’s versionFather Chrysostomos2011-05-191-1/+1
| | | | because of the upcoming patch
* [perl #90122] Make h2ph correctly search gcc include directoriesNiko Tyni2011-05-191-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | System header conversion with "h2ph -a" is currently broken on Ubuntu Natty and Oneiric (unless the gcc-multilib package is installed for backward compatibility), resulting in things like # perl -e 'require "syscall.ph"' Can't locate asm/unistd.ph in @INC [...] This happens because Ubuntu has switched to a 'multiarch' setup, see <https://wiki.ubuntu.com/MultiarchSpec> for details. The asm subdirectory isn't in $Config{usrinc} anymore: /usr/include/asm is now /usr/include/x86_64-linux-gnu/asm. (The third component of the new path varies with the actual architecture.) gcc --print-search-dirs doesn't really tell anything about where gcc looks for the include directories, it was just used to find the gcc internal directory prefix. Parse the output of "gcc -v -E" instead, and append $Config{usrinc} for safety. Duplicates shouldn't matter. The h2ph "-a" switch isn't currently tested automatically, and that seems nontrivial to do portably. Manual testing was done with # mkdir ttt # ./perl -Ilib ./utils/h2ph -a -d $(pwd)/ttt syscall.h The gcc invocation has been tested to work with gcc 4.6, 4.1, and 3.3. http://bugs.debian.org/625808 https://bugs.launchpad.net/bugs/777903
* Remove PERL_UNUSED_ARG() from Perl_magic_clearsig(), missed by 179c85a2d774d3beNicholas Clark2011-05-191-1/+0
|
* Remove duplicate code from pp_study(), caused by a4f4e9060b702ac8.Nicholas Clark2011-05-191-4/+0
| | | | | | | The duplicated code could have had no effect - for the case of pos <= 0 pp_study had already returned NO. The second call to SvPV() would have had no side effects, because scalars with side effects don't have SvPOK() true, so would also have already returned NO.
* Create open_print_header() to avoid duplicate parameters to open_new().Nicholas Clark2011-05-191-11/+11
|
* Rename do_not_edit() to open_print_header(), and move open_new() into it.Nicholas Clark2011-05-191-22/+19
| | | | This removes duplication of open_new() calls.
* Add a 'quote' argument to read_only_top(), to pass in an optional Tolkien.Nicholas Clark2011-05-193-16/+16
| | | | Use this in embed.pl for perlapi.c, and reentr.pl for reentr.c.
* Add an optional third argument to open_new(), to invoke read_only_top() with.Nicholas Clark2011-05-1914-65/+54
| | | | Merge together many calls to open_new() and read_only_top().
* In regen/uconfig_h.pl use read_only_bottom_close_and_rename().Nicholas Clark2011-05-192-16/+8
| | | | | This eliminates the only remaining external caller of read_only_bottom(), so inline read_only_bottom() into read_only_bottom_close_and_rename().
* Merge safer_close() and rename_if_different() into close_and_rename()Nicholas Clark2011-05-193-37/+26
| | | | Inline safer_rename() into its only caller, close_and_rename().
* Add an optional 'mode' argument to open_new(), to open for appending.Nicholas Clark2011-05-192-8/+14
| | | | Use this in regen/uconfig_h.pl
* Rename safer_open() to open_new(), and eliminate the first parameter.Nicholas Clark2011-05-1917-37/+36
| | | | Update the SHA256s where necessary in the generated files.