| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
http://rt.perl.org/rt3/Ticket/Display.html?id=69056
In perl 5.8 we get this:
$ perl -Mre=debug -le '$_="foo"; s/(.)\G//g; print'
Freeing REx: `","'
Compiling REx `(.)\G'
size 7 Got 60 bytes for offset annotations.
first at 3
1: OPEN1(3)
3: REG_ANY(4)
4: CLOSE1(6)
6: GPOS(7)
7: END(0)
GPOS minlen 1
Offsets: [7]
1[1] 0[0] 2[1] 3[1] 0[0] 4[2] 6[0]
Matching REx `(.)\G' against `foo'
Setting an EVAL scope, savestack=3
0 <> <foo> | 1: OPEN1
0 <> <foo> | 3: REG_ANY
1 <f> <oo> | 4: CLOSE1
1 <f> <oo> | 6: GPOS
failed...
Setting an EVAL scope, savestack=3
1 <f> <oo> | 1: OPEN1
1 <f> <oo> | 3: REG_ANY
2 <fo> <o> | 4: CLOSE1
2 <fo> <o> | 6: GPOS
failed...
Setting an EVAL scope, savestack=3
2 <fo> <o> | 1: OPEN1
2 <fo> <o> | 3: REG_ANY
3 <foo> <> | 4: CLOSE1
3 <foo> <> | 6: GPOS
failed...
Setting an EVAL scope, savestack=3
3 <foo> <> | 1: OPEN1
3 <foo> <> | 3: REG_ANY
failed...
Match failed
foo
Freeing REx: `"(.)\\G"'
In perl 5.10 we get this:
$ perl -Mre=debug -le '$_="foo"; s/(.)\G//g; print'
Compiling REx "(.)\G"
Final program:
1: OPEN1 (3)
3: REG_ANY (4)
4: CLOSE1 (6)
6: GPOS (7)
7: END (0)
anchored(GPOS) GPOS:1 minlen 1
Matching REx "(.)\G" against "foo"
-1 <> <%0foo> | 1:OPEN1(3)
-1 <> <%0foo> | 3:REG_ANY(4)
0 <> <foo> | 4:CLOSE1(6)
0 <> <foo> | 6:GPOS(7)
0 <> <foo> | 7:END(0)
Match successful!
Segmentation fault
With this patch we get:
$ ./perl -Ilib -Mre=debug -le '$_="foo"; s/(.)\G//g; print'
Compiling REx "(.)\G"
Final program:
1: OPEN1 (3)
3: REG_ANY (4)
4: CLOSE1 (6)
6: GPOS (7)
7: END (0)
anchored(GPOS) GPOS:1 minlen 1
Matching REx "(.)\G" against "foo"
Match failed
foo
Freeing REx: "(.)\G"
Which seems to me to be a net improvement.
|
|
|
|
|
|
|
|
|
|
|
| |
Commit c74340f9 added backreferences as well as the idea of a ->swap
regex pointer to keep track of the match offsets in case of backtracking.
The problem is that when Perl re-enters the regex engine to handle
utf8::SWASHNEW, the ->swap is not saved/restored/cleared so any capture
from the utf8 (Perl) code could inadvertently modify the regex match
data that caused the utf8 swash to get built.
This change should close out RT #60508
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the op inside of a (?{ }) construct is another regex, the two
regexen end up corrupting each others' end-of-string markers,
resulting in various pathologies including access violations,
stack corruptions, and memory use growing without bound.
The change here is intended to be a relatively safe, cheap way to
prevent memory errors and makes no attempt to save and restore
other aspects of regex state; i.e., general purpose reentrancy
for the regex engine is still a TODO.
|
|
|
|
|
|
|
|
| |
This looks to be a simple oversight. All tests pass here.
Hugo
Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PL_reglastparen and PL_reglastcloseparen contains a pointer are set to & rex->lastparen and & rex->lastcloseparen.
In case END the rex var is modified but PL_reglastparen and PL_reglastcloseparen is not.
Some part of the codes access PL_reglastparen while other parts use rex->lastparen.
This patch corrects this and adds 3 assertions.
I'm currently unable to proof (with a test case) that the code in case EVAL_ab is really nessesary...
Logically speaking it is nessesary but I do not know if it can cause test failures.
Also in the patch are missing regressions between 5.8 -> 5.10 and 5.10 -> 5.11. (and a test script that contains these regressions)
Message-ID: <rt-3.6.HEAD-4802-1236806863-900.56194-15-0@perl.org>
[Includes message and patch edits by committer.]
|
| |
|
|
|
|
|
|
|
| |
(reminder)
Date: 17 Nov 2007 16:29:29 +0100
Message-ID: <87r6iohova.fsf@biokovo-amd64.herceg.de>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
As Nicholas already noted in a FIXME, assigning to DEFSV should
use GvSV instead of GvSVn. This change ensures that, at least
under -DPERL_CORE, DEFSV cannot be assigned to and introduces
a DEFSV_set macro to allow setting DEFSV.
This fixes #53038: map leaks memory.
p4raw-id: //depot/perl@34776
|
|
|
|
|
|
|
| |
MUTABLE_SV() check. Use SvPVX_const() instead of SvPVX()
where only a const SV* is available. Also fix two falsely
consted pointers in Perl_sv_2pv_flags().
p4raw-id: //depot/perl@34770
|
|
|
|
|
|
|
|
|
|
|
| |
* Make ANYOF output from regprop easier to read by adding ][ in between the unicode representation and the "ascii" one
* Make it possible to make tests in re_tests todo.
* add a todo test for a complementary character class match that should fail (perl #60156)
* Also add a comment explaining a previous commit (relating to perl #60344)
p4raw-id: //depot/perl@34755
|
|
|
|
|
|
|
|
|
|
| |
5.10
During the de-recursivization it looks like Dave M forgot to reset the 'logical'
flag after using it, which in turn causes UNLESSM/IFTHEN when used after a LOGICAL operator to
be incorrectly intrepreted. This change resets the logical flag after each time it is stored
in ST.logical.
p4raw-id: //depot/perl@34746
|
|
|
|
|
|
| |
Message-ID: <25940.1225611819@chthon>
Date: Sun, 02 Nov 2008 01:43:39 -0600
p4raw-id: //depot/perl@34698
|
|
|
|
|
| |
erroneous const in dump.c.
p4raw-id: //depot/perl@34675
|
|
|
| |
p4raw-id: //depot/perl@34650
|
|
|
| |
p4raw-id: //depot/perl@34629
|
|
|
| |
p4raw-id: //depot/perl@34585
|
|
|
|
|
|
|
|
|
|
|
|
| |
ability to create landmines that will explode under someone in the
future when they upgrade their compiler to one with better
optimisation. We've already done this at least twice.
(Yes, some of the assertions are after code that would already have
SEGVd because it already deferences a pointer, but they are put in
to make it easier to automate checking that each and every case is
covered.)
Add a tool, checkARGS_ASSERT.pl, to check that every case is covered.
p4raw-id: //depot/perl@33291
|
|
|
|
|
|
| |
indirectly via RVs. This saves memory, and removes 1 level of pointer
indirection.
p4raw-id: //depot/perl@32950
|
|
|
|
|
| |
ithreads, so don't waste time doing it there.
p4raw-id: //depot/perl@32939
|
|
|
|
|
|
| |
rather than put in lots of hacks to work round not reference counting
it.
p4raw-id: //depot/perl@32938
|
|
|
| |
p4raw-id: //depot/perl@32913
|
|
|
|
|
|
| |
reference count only needs "doubling" when the scalar is pushed onto
PL_regex_padav for the second time.
p4raw-id: //depot/perl@32899
|
|
|
| |
p4raw-id: //depot/perl@32895
|
|
|
| |
p4raw-id: //depot/perl@32861
|
|
|
|
|
|
|
|
| |
inside of (?{...}) blocks as reported by Moritz Lenz in
Subject: Bugs in extended regexp features
Message-ID: <477FACED.4000505@casella.verplant.org>
p4raw-id: //depot/perl@32857
|
|
|
|
|
|
| |
be accessed via RXp_PAREN_NAMES(). (They are entirely within the
regexp implementation).
p4raw-id: //depot/perl@32853
|
|
|
| |
p4raw-id: //depot/perl@32852
|
|
|
|
|
| |
bit in pmflags, to decide whether the pattern is UTF-8.
p4raw-id: //depot/perl@32851
|
|
|
| |
p4raw-id: //depot/perl@32850
|
|
|
| |
p4raw-id: //depot/perl@32849
|
|
|
|
|
|
|
| |
Remove RXp_PRECOMP() and RXp_WRAPPED().
Change the parameter of S_debug_start_match() from regexp to REGEXP.
Change its callers [the only part wrong for 5.10.x]
p4raw-id: //depot/perl@32840
|
|
|
|
|
|
| |
and regexp reference counting is via the regular SV reference counting.
This was not as easy at it looks.
p4raw-id: //depot/perl@32804
|
|
|
|
|
|
|
| |
regcomp.c and regexec.c RXp_* where necessary] so that in future we
can maintain source compatibility when we add an extra level of
dereferencing.
p4raw-id: //depot/perl@32802
|
|
|
|
|
|
| |
the macros RX_PRECOMP() and RX_PRELEN(). This will allow us to reduce
the regexp storage overhead by computing them at retrieve time.
p4raw-id: //depot/perl@32753
|
|
|
| |
p4raw-id: //depot/perl@32751
|
|
|
|
|
|
| |
so don't upgrade them to ORANGE before attaching qr magic.
(And don't stop using qr magic once regexps become first class)
p4raw-id: //depot/perl@32748
|
|
|
|
|
| |
Add a comment about the mg_find() that follows.
p4raw-id: //depot/perl@32742
|
|
|
|
|
| |
(Correct a comparison of $] with 5.011 in B.pm)
p4raw-id: //depot/perl@32740
|
|
|
| |
p4raw-id: //depot/perl@32630
|
|
|
|
|
|
|
| |
Related to [perl #36207] among others
Message-ID: <9b18b3110712170621h41de2c76k331971e3660abcb0@mail.gmail.com>
p4raw-id: //depot/perl@32628
|
|
|
|
|
|
|
| |
Message-ID: <20071107001845.GA21000@bort.ca>
[plus remove the TODO from the now passing test]
p4raw-id: //depot/perl@32236
|
|
|
|
|
| |
Message-ID: <46D617B5.3000002@iki.fi>
p4raw-id: //depot/perl@31765
|
|
|
|
|
|
|
|
|
|
| |
ensure proper scope cleanup.
Fix and test for issue raised in:
Subject: Very strange interaction between regex and lexical array in blead
Message-ID: <20070818015537.0088db31@r2d2>
p4raw-id: //depot/perl@31733
|
|
|
| |
p4raw-id: //depot/perl@31455
|
|
|
|
|
|
|
|
| |
change #28398 accidently made the last branch of an alternation
not restore the paren state after failure backtrack. Fix this by
removing the last-branch-skips-pushing-a-state optimisation.
p4raw-link: @28398 on //depot/perl: 40a824489101168f94fce98aa2824baf40bad402
p4raw-id: //depot/perl@31417
|
|
|
|
|
|
|
|
|
| |
Some code in regexec.c had a comment to the effect that without
this code, Dynaloader failed (this is back at 5.6.0). Replace the
comments with something more specific, and add a test for it
(basically without the code $1 is '' rather than undefined
sometimes).
p4raw-id: //depot/perl@31408
|