[packages/perl] - fix for failed re test

baggins baggins at pld-linux.org
Fri May 24 18:36:12 CEST 2013


commit b003a5adf8b25eb752c51d792315621dc9e4e4e9
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Fri May 24 18:35:46 2013 +0200

    - fix for failed re test

 perl-fix-pointer-arithmetic.patch | 49 +++++++++++++++++++++++++++++++++++++++
 perl.spec                         | 10 ++------
 2 files changed, 51 insertions(+), 8 deletions(-)
---
diff --git a/perl.spec b/perl.spec
index 9a826f1..30885dd 100644
--- a/perl.spec
+++ b/perl.spec
@@ -6,14 +6,6 @@
 %bcond_with	microperl	# build microperl (needs fixing)
 #
 # TODO:
-# - on i486 and i686 the following tests fail:
-# t/re/pat_rt_report_thr ........................................ FAILED at test 55
-# Failed test 55 - UTF-8 regex matches above 32k; Bug 20020630.002 at re/pat_rt_report.t line 224
-# <utf8 x 32000>; pos = 1
-# Failed test 57 - UTF-8 regex matches above 32k; Bug 20020630.002 at re/pat_rt_report.t line 224
-# <utf8 x 32768>; pos = 1
-# Failed test 59 - UTF-8 regex matches above 32k; Bug 20020630.002 at re/pat_rt_report.t line 224
-# <utf8 x 33000>; pos = 1
 # - fix "FIXME"s
 # - add the {O,N}DBM_File modules
 # - `diagnostics.pm' (perl-base) requires `perldiag.pod' (perl-perldoc)
@@ -92,6 +84,7 @@ Patch4:		%{name}-test-noproc.patch
 Patch5:		%{name}_585-microperl_uconfig.patch
 Patch6:		%{name}-write-permissions.patch
 Patch7:		%{name}-t-syslog.patch
+Patch8:		%{name}-fix-pointer-arithmetic.patch
 URL:		http://dev.perl.org/perl5/
 %ifarch ppc
 # gcc 3.3.x miscompiles pp_hot.c
@@ -603,6 +596,7 @@ z biblioteki GNU gdbm.
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
+%patch8 -p1
 
 cat > runperl <<'EOF'
 #!/bin/sh
diff --git a/perl-fix-pointer-arithmetic.patch b/perl-fix-pointer-arithmetic.patch
new file mode 100644
index 0000000..1fe93d4
--- /dev/null
+++ b/perl-fix-pointer-arithmetic.patch
@@ -0,0 +1,49 @@
+# Fix pointer arithmetic overflow introduced in upstream commit 4063ade8503ac8877a02fc4eae8ebbe242b9110b,
+# which caused the following tests to fail on i486 and i686:
+# t/re/pat_rt_report_thr ........................................ FAILED at test 55
+# Failed test 55 - UTF-8 regex matches above 32k; Bug 20020630.002 at re/pat_rt_report.t line 224
+# <utf8 x 32000>; pos = 1
+# Failed test 57 - UTF-8 regex matches above 32k; Bug 20020630.002 at re/pat_rt_report.t line 224
+# <utf8 x 32768>; pos = 1
+# Failed test 59 - UTF-8 regex matches above 32k; Bug 20020630.002 at re/pat_rt_report.t line 224
+# <utf8 x 33000>; pos = 1
+diff --git a/regexec.c b/regexec.c
+index bc38839..6199677 100644
+--- a/regexec.c
++++ b/regexec.c
+@@ -6662,7 +6662,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
+     scan = *startposp;
+     if (max == REG_INFTY)
+ 	max = I32_MAX;
+-    else if (! utf8_target && scan + max < loceol)
++    else if (! utf8_target && max < loceol - scan)
+ 	loceol = scan + max;
+ 
+     /* Here, for the case of a non-UTF-8 target we have adjusted <loceol> down
+@@ -6711,7 +6711,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
+ 	    scan = loceol;
+ 	break;
+     case CANY:  /* Move <scan> forward <max> bytes, unless goes off end */
+-        if (utf8_target && scan + max < loceol) {
++        if (utf8_target && max < loceol - scan) {
+ 
+             /* <loceol> hadn't been adjusted in the UTF-8 case */
+             scan +=  max;
+@@ -6730,7 +6730,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
+          * can use UTF8_IS_INVARIANT() even if the pattern isn't UTF-8, as it's
+          * true iff it doesn't matter if the argument is in UTF-8 or not */
+         if (UTF8_IS_INVARIANT(c) || (! utf8_target && ! is_utf8_pat)) {
+-            if (utf8_target && scan + max < loceol) {
++            if (utf8_target && max < loceol - scan) {
+                 /* We didn't adjust <loceol> because is UTF-8, but ok to do so,
+                  * since here, to match at all, 1 char == 1 byte */
+                 loceol = scan + max;
+@@ -6910,7 +6910,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
+         /* FALLTHROUGH */
+ 
+     case POSIXA:
+-        if (utf8_target && scan + max < loceol) {
++        if (utf8_target && max < loceol - scan) {
+ 
+             /* We didn't adjust <loceol> at the beginning of this routine
+              * because is UTF-8, but it is actually ok to do so, since here, to
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/perl.git/commitdiff/b003a5adf8b25eb752c51d792315621dc9e4e4e9



More information about the pld-cvs-commit mailing list