Fix DFA match for a possessively repeated character class
This commit is contained in:
parent
5f33918b5b
commit
8e80c804e1
@ -0,0 +1,67 @@
|
|||||||
|
From 881b9580da401953f2a94b42cb9cc275b4719341 Mon Sep 17 00:00:00 2001
|
||||||
|
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
||||||
|
Date: Wed, 22 Mar 2017 15:17:45 +0000
|
||||||
|
Subject: [PATCH] Fix DFA match handling of possessive repeated character class
|
||||||
|
(Bugzilla 2086).
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1689 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
||||||
|
|
||||||
|
Petr Písař: Ported to 8.40.
|
||||||
|
---
|
||||||
|
pcre_dfa_exec.c | 4 ++--
|
||||||
|
testdata/testinput8 | 3 +++
|
||||||
|
testdata/testoutput8 | 4 ++++
|
||||||
|
|
||||||
|
diff --git a/pcre_dfa_exec.c b/pcre_dfa_exec.c
|
||||||
|
index 170ce6a..bc09ced 100644
|
||||||
|
--- a/pcre_dfa_exec.c
|
||||||
|
+++ b/pcre_dfa_exec.c
|
||||||
|
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language (but see
|
||||||
|
below for why this module is different).
|
||||||
|
|
||||||
|
Written by Philip Hazel
|
||||||
|
- Copyright (c) 1997-2014 University of Cambridge
|
||||||
|
+ Copyright (c) 1997-2017 University of Cambridge
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
@@ -2625,7 +2625,7 @@ for (;;)
|
||||||
|
if (isinclass)
|
||||||
|
{
|
||||||
|
int max = (int)GET2(ecode, 1 + IMM2_SIZE);
|
||||||
|
- if (*ecode == OP_CRPOSRANGE)
|
||||||
|
+ if (*ecode == OP_CRPOSRANGE && count >= (int)GET2(ecode, 1))
|
||||||
|
{
|
||||||
|
active_count--; /* Remove non-match possibility */
|
||||||
|
next_active_state--;
|
||||||
|
diff --git a/testdata/testinput8 b/testdata/testinput8
|
||||||
|
index 7f8fa82..e931410 100644
|
||||||
|
--- a/testdata/testinput8
|
||||||
|
+++ b/testdata/testinput8
|
||||||
|
@@ -4845,4 +4845,7 @@
|
||||||
|
aaa\D
|
||||||
|
a\D
|
||||||
|
|
||||||
|
+/(02-)?[0-9]{3}-[0-9]{3}/
|
||||||
|
+ 02-123-123
|
||||||
|
+
|
||||||
|
/-- End of testinput8 --/
|
||||||
|
diff --git a/testdata/testoutput8 b/testdata/testoutput8
|
||||||
|
index 17b667a..4984376 100644
|
||||||
|
--- a/testdata/testoutput8
|
||||||
|
+++ b/testdata/testoutput8
|
||||||
|
@@ -7801,4 +7801,8 @@ No match
|
||||||
|
** Show all captures ignored after DFA matching
|
||||||
|
0: a
|
||||||
|
|
||||||
|
+/(02-)?[0-9]{3}-[0-9]{3}/
|
||||||
|
+ 02-123-123
|
||||||
|
+ 0: 02-123-123
|
||||||
|
+
|
||||||
|
/-- End of testinput8 --/
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
#%%global rcversion RC1
|
#%%global rcversion RC1
|
||||||
Name: pcre
|
Name: pcre
|
||||||
Version: 8.40
|
Version: 8.40
|
||||||
Release: %{?rcversion:0.}5%{?rcversion:.%rcversion}%{?dist}
|
Release: %{?rcversion:0.}6%{?rcversion:.%rcversion}%{?dist}
|
||||||
%global myversion %{version}%{?rcversion:-%rcversion}
|
%global myversion %{version}%{?rcversion:-%rcversion}
|
||||||
Summary: Perl-compatible regular expression library
|
Summary: Perl-compatible regular expression library
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
@ -59,6 +59,9 @@ Patch8: pcre-8.40-Minor-doc-update.patch
|
|||||||
# point greater than 0x10ffff in UTF-32 library while UTF mode is disabled,
|
# point greater than 0x10ffff in UTF-32 library while UTF mode is disabled,
|
||||||
# upstream bug #2052, in upstream after 8.40
|
# upstream bug #2052, in upstream after 8.40
|
||||||
Patch9: pcre-8.40-Fix-Unicode-property-crash-for-32-bit-characters-gre.patch
|
Patch9: pcre-8.40-Fix-Unicode-property-crash-for-32-bit-characters-gre.patch
|
||||||
|
# Fix DFA match for a possessively repeated character class,
|
||||||
|
# upstream bug #2086, in upstream after 8.40
|
||||||
|
Patch10: pcre-8.40-Fix-DFA-match-handling-of-possessive-repeated-charac.patch
|
||||||
BuildRequires: readline-devel
|
BuildRequires: readline-devel
|
||||||
BuildRequires: autoconf
|
BuildRequires: autoconf
|
||||||
BuildRequires: automake
|
BuildRequires: automake
|
||||||
@ -157,6 +160,7 @@ Utilities demonstrating PCRE capabilities like pcregrep or pcretest.
|
|||||||
%patch7 -p1
|
%patch7 -p1
|
||||||
%patch8 -p1
|
%patch8 -p1
|
||||||
%patch9 -p1
|
%patch9 -p1
|
||||||
|
%patch10 -p1
|
||||||
# Because of rpath patch
|
# Because of rpath patch
|
||||||
libtoolize --copy --force
|
libtoolize --copy --force
|
||||||
autoreconf -vif
|
autoreconf -vif
|
||||||
@ -253,6 +257,9 @@ make %{?_smp_mflags} check VERBOSE=yes
|
|||||||
%{_mandir}/man1/pcretest.*
|
%{_mandir}/man1/pcretest.*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Mar 27 2017 Petr Pisar <ppisar@redhat.com> - 8.40-6
|
||||||
|
- Fix DFA match for a possessively repeated character class (upstream bug #2086)
|
||||||
|
|
||||||
* Mon Feb 27 2017 Petr Pisar <ppisar@redhat.com> - 8.40-5
|
* Mon Feb 27 2017 Petr Pisar <ppisar@redhat.com> - 8.40-5
|
||||||
- Fix a crash in pcretest when \O directive was supplied with too big number
|
- Fix a crash in pcretest when \O directive was supplied with too big number
|
||||||
(upstream bug #2044)
|
(upstream bug #2044)
|
||||||
|
Loading…
Reference in New Issue
Block a user