summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2017-03-20 03:44:52 -0400
committerMike Frysinger <vapier@gentoo.org>2017-03-20 03:48:01 -0400
commitef1e0f46ae56483d3b5695108e684a887bab4d33 (patch)
tree0004d9bd09cc8146de04c981e7798b40634ca818 /dev-libs/libpcre/files
parentnet-dns/libidn2: Old. (diff)
downloadgentoo-ef1e0f46ae56483d3b5695108e684a887bab4d33.tar.gz
gentoo-ef1e0f46ae56483d3b5695108e684a887bab4d33.tar.bz2
gentoo-ef1e0f46ae56483d3b5695108e684a887bab4d33.zip
dev-libs/libpcre: add upstream fixes for pcregrep & jit compiler #609592
Diffstat (limited to 'dev-libs/libpcre/files')
-rw-r--r--dev-libs/libpcre/files/libpcre-8.40-jit-else.patch68
-rw-r--r--dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-1.patch69
-rw-r--r--dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-2.patch25
3 files changed, 162 insertions, 0 deletions
diff --git a/dev-libs/libpcre/files/libpcre-8.40-jit-else.patch b/dev-libs/libpcre/files/libpcre-8.40-jit-else.patch
new file mode 100644
index 000000000000..d347a7f5e1e0
--- /dev/null
+++ b/dev-libs/libpcre/files/libpcre-8.40-jit-else.patch
@@ -0,0 +1,68 @@
+https://bugs.gentoo.org/609592
+https://bugs.exim.org/show_bug.cgi?id=2035
+
+From 7ddfbe9d0b9f43402f8043e940172a318cc407c6 Mon Sep 17 00:00:00 2001
+From: Zoltan Herczeg <hzmester@freemail.hu>
+Date: Tue, 14 Feb 2017 08:48:18 +0000
+Subject: [PATCH] Fix a missing else in the JIT compiler reported by
+ 'idaifish'.
+
+git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1680 2f5784b3-3f2a-0410-8824-cb99058d5e15
+---
+ ChangeLog | 2 ++
+ pcre_jit_compile.c | 2 +-
+ testdata/testinput12 | 2 ++
+ testdata/testoutput12 | 2 ++
+ 4 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 373ee8422ef5..d813935539bd 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -15,6 +15,8 @@ mode with --only-matching matched several lines, it restarted scanning at the
+ next line instead of moving on to the end of the matched string, which can be
+ several lines after the start.
+
++3. Fix a missing else in the JIT compiler reported by 'idaifish'.
++
+
+ Version 8.40 11-January-2017
+ ----------------------------
+diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c
+index c301f05d5e3f..6ef8e48ff5e8 100644
+--- a/pcre_jit_compile.c
++++ b/pcre_jit_compile.c
+@@ -8110,7 +8110,7 @@ if (opcode == OP_COND || opcode == OP_SCOND)
+
+ if (*matchingpath == OP_FAIL)
+ stacksize = 0;
+- if (*matchingpath == OP_RREF)
++ else if (*matchingpath == OP_RREF)
+ {
+ stacksize = GET2(matchingpath, 1);
+ if (common->currententry == NULL)
+diff --git a/testdata/testinput12 b/testdata/testinput12
+index 944be6943f5e..89ed4564bcd4 100644
+--- a/testdata/testinput12
++++ b/testdata/testinput12
+@@ -104,4 +104,6 @@ and a couple of things that are different with JIT. --/
+ /(.|.)*?bx/
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabax
+
++/((?(?!))x)(?'name')(?1)/S++
++
+ /-- End of testinput12 --/
+diff --git a/testdata/testoutput12 b/testdata/testoutput12
+index 87911086f498..7632c4e58013 100644
+--- a/testdata/testoutput12
++++ b/testdata/testoutput12
+@@ -201,4 +201,6 @@ No match, mark = m (JIT)
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabax
+ Error -8 (match limit exceeded)
+
++/((?(?!))x)(?'name')(?1)/S++
++
+ /-- End of testinput12 --/
+--
+2.12.0
+
diff --git a/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-1.patch b/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-1.patch
new file mode 100644
index 000000000000..f15968dfe98e
--- /dev/null
+++ b/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-1.patch
@@ -0,0 +1,69 @@
+From 5be027b624bc866702808abadfe5f99360414086 Mon Sep 17 00:00:00 2001
+From: Philip Hazel <ph10@cam.ac.uk>
+Date: Fri, 10 Feb 2017 17:47:34 +0000
+Subject: [PATCH] Correct fix for pcre2grep multiline with --only-matching.
+
+git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1678 2f5784b3-3f2a-0410-8824-cb99058d5e15
+---
+ ChangeLog | 5 +++++
+ configure.ac | 6 +++---
+ pcregrep.c | 20 +++++++++++++++-----
+ 3 files changed, 23 insertions(+), 8 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index ab4e053e601e..373ee8422ef5 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -10,6 +10,11 @@ Version 8.41
+ 1. Fixed typo in CMakeLists.txt (wrong number of arguments for
+ PCRE_STATIC_RUNTIME (affects MSVC only).
+
++2. Issue 1 for 8.40 below was not correctly fixed. If pcregrep in multiline
++mode with --only-matching matched several lines, it restarted scanning at the
++next line instead of moving on to the end of the matched string, which can be
++several lines after the start.
++
+
+ Version 8.40 11-January-2017
+ ----------------------------
+diff --git a/pcregrep.c b/pcregrep.c
+index fd2a67622baa..2070c057e4a0 100644
+--- a/pcregrep.c
++++ b/pcregrep.c
+@@ -1804,11 +1804,6 @@ while (ptr < endptr)
+ if (line_buffered) fflush(stdout);
+ rc = 0; /* Had some success */
+
+- /* If the current match ended past the end of the line (only possible
+- in multiline mode), we are done with this line. */
+-
+- if ((unsigned int)offsets[1] > linelength) goto END_ONE_MATCH;
+-
+ startoffset = offsets[1]; /* Restart after the match */
+ if (startoffset <= oldstartoffset)
+ {
+@@ -1818,6 +1813,21 @@ while (ptr < endptr)
+ if (utf8)
+ while ((matchptr[startoffset] & 0xc0) == 0x80) startoffset++;
+ }
++
++ /* If the current match ended past the end of the line (only possible
++ in multiline mode), we must move on to the line in which it did end
++ before searching for more matches. */
++
++ while (startoffset > (int)linelength)
++ {
++ matchptr = ptr += linelength + endlinelength;
++ filepos += (int)(linelength + endlinelength);
++ linenumber++;
++ startoffset -= (int)(linelength + endlinelength);
++ t = end_of_line(ptr, endptr, &endlinelength);
++ linelength = t - ptr - endlinelength;
++ }
++
+ goto ONLY_MATCHING_RESTART;
+ }
+ }
+--
+2.12.0
+
diff --git a/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-2.patch b/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-2.patch
new file mode 100644
index 000000000000..63ad51cd1047
--- /dev/null
+++ b/dev-libs/libpcre/files/libpcre-8.40-pcregrep-multiline-2.patch
@@ -0,0 +1,25 @@
+From 8b0fdf16e57ce9a653a0a03c39f6cc061e8122e8 Mon Sep 17 00:00:00 2001
+From: Philip Hazel <ph10@cam.ac.uk>
+Date: Sun, 12 Feb 2017 13:28:11 +0000
+Subject: [PATCH] Fix bug in most recent fix for multiline pcre2grep.
+
+git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1679 2f5784b3-3f2a-0410-8824-cb99058d5e15
+---
+ pcregrep.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/pcregrep.c b/pcregrep.c
+index 2070c057e4a0..3cd70eeb4261 100644
+--- a/pcregrep.c
++++ b/pcregrep.c
+@@ -1826,6 +1826,7 @@ while (ptr < endptr)
+ startoffset -= (int)(linelength + endlinelength);
+ t = end_of_line(ptr, endptr, &endlinelength);
+ linelength = t - ptr - endlinelength;
++ length = (size_t)(endptr - ptr);
+ }
+
+ goto ONLY_MATCHING_RESTART;
+--
+2.12.0
+