From 0fa18554ff6de06e89b8589f26a054250d6a74a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Mon, 22 May 2017 11:41:02 +0200 Subject: [PATCH] Restore compatibility with Perl 5.26.0 --- ...-5.25-or-5.22-24-with-PERL_OP_PARENT.patch | 95 +++++++++++++++++++ perl-Params-Classify.spec | 9 +- 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 Params-Classify-0.013-Fix-5.25-or-5.22-24-with-PERL_OP_PARENT.patch diff --git a/Params-Classify-0.013-Fix-5.25-or-5.22-24-with-PERL_OP_PARENT.patch b/Params-Classify-0.013-Fix-5.25-or-5.22-24-with-PERL_OP_PARENT.patch new file mode 100644 index 0000000..a3964c8 --- /dev/null +++ b/Params-Classify-0.013-Fix-5.25-or-5.22-24-with-PERL_OP_PARENT.patch @@ -0,0 +1,95 @@ +From 0d301779bd42da52b4f8e13a667499846fc2cc55 Mon Sep 17 00:00:00 2001 +From: Reini Urban +Date: Tue, 14 Jun 2016 17:08:24 +0200 +Subject: [PATCH] Fix 5.25 or 5.22/24 with PERL_OP_PARENT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes RT #114490 + +Signed-off-by: Petr Písař +--- + lib/Params/Classify.xs | 36 ++++++++++++++++++++++++++---------- + 1 file changed, 26 insertions(+), 10 deletions(-) + +diff --git a/lib/Params/Classify.xs b/lib/Params/Classify.xs +index 15a5ad5..f4012fd 100644 +--- a/lib/Params/Classify.xs ++++ b/lib/Params/Classify.xs +@@ -123,6 +123,22 @@ static void *THX_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, void *from) + # define sv_is_regexp(sv) 0 + #endif /* <5.11.0 */ + ++ ++#ifndef OpSIBLING ++# ifdef PERL_OP_PARENT ++# define OpSIBLING(o) (0 + (o)->op_moresib ? (o)->op_sibparent : NULL) ++# define OpMAYBESIB_set(o, sib, parent) \ ++ ((o)->op_sibparent = ((o)->op_moresib = cBOOL(sib)) ? (sib) : (parent)) ++# else ++# define OpSIBLING(o) (0 + (o)->op_sibling) ++# if PERL_VERSION_GE(5,11,0) ++# define OpMAYBESIB_set(o, sib, parent) ((o)->op_sibling = (sib)) ++# else ++# define OpMAYBESIB_set(o, sib, parent) ((o)->op_moresib = cBOOL(sib), (o)->op_sibling = (sib)) ++# endif ++# endif ++#endif ++ + #define sv_is_undef(sv) (!sv_is_glob(sv) && !sv_is_regexp(sv) && !SvOK(sv)) + + #define sv_is_string(sv) \ +@@ -631,8 +647,8 @@ static OP *myck_entersub(pTHX_ OP *op) + OP *(*ppfunc)(pTHX); + I32 cvflags; + pushop = cUNOPx(op)->op_first; +- if(!pushop->op_sibling) pushop = cUNOPx(pushop)->op_first; +- for(cvop = pushop; cvop->op_sibling; cvop = cvop->op_sibling) ; ++ if(!OpSIBLING(pushop)) pushop = cUNOPx(pushop)->op_first; ++ for(cvop = pushop; OpSIBLING(cvop); cvop = OpSIBLING(cvop)) ; + if(!(cvop->op_type == OP_RV2CV && + !(cvop->op_private & OPpENTERSUB_AMPER) && + (cv = rvop_cv(cUNOPx(cvop)->op_first)) && +@@ -641,20 +657,20 @@ static OP *myck_entersub(pTHX_ OP *op) + return nxck_entersub(aTHX_ op); + cvflags = CvXSUBANY(cv).any_i32; + op = nxck_entersub(aTHX_ op); /* for prototype checking */ +- aop = pushop->op_sibling; +- bop = aop->op_sibling; ++ aop = OpSIBLING(pushop); ++ bop = OpSIBLING(aop); + if(bop == cvop) { + if(!(cvflags & PC_ALLOW_UNARY)) return op; + unary: +- pushop->op_sibling = bop; +- aop->op_sibling = NULL; ++ OpMAYBESIB_set(pushop, bop, NULL); ++ OpMAYBESIB_set(aop, NULL, NULL); + op_free(op); + op = newUNOP(OP_NULL, 0, aop); + op->op_type = OP_RAND; + op->op_ppaddr = ppfunc; + op->op_private = (U8)cvflags; + return op; +- } else if(bop && bop->op_sibling == cvop) { ++ } else if(bop && OpSIBLING(bop) == cvop) { + if(!(cvflags & PC_ALLOW_BINARY)) return op; + if(ppfunc == THX_pp_check_sclass && + (cvflags & PC_TYPE_MASK) == SCLASS_REF) { +@@ -673,9 +689,9 @@ static OP *myck_entersub(pTHX_ OP *op) + cvflags &= ~PC_TYPE_MASK; + ppfunc = THX_pp_check_dyn_battr; + } +- pushop->op_sibling = cvop; +- aop->op_sibling = NULL; +- bop->op_sibling = NULL; ++ OpMAYBESIB_set(pushop, cvop, NULL); ++ OpMAYBESIB_set(aop, NULL, NULL); ++ OpMAYBESIB_set(bop, NULL, NULL); + op_free(op); + op = newBINOP(OP_NULL, 0, aop, bop); + op->op_type = OP_RAND; +-- +2.9.4 + diff --git a/perl-Params-Classify.spec b/perl-Params-Classify.spec index 84c7830..858aeeb 100644 --- a/perl-Params-Classify.spec +++ b/perl-Params-Classify.spec @@ -1,11 +1,14 @@ Name: perl-Params-Classify Version: 0.013 -Release: 17%{?dist} +Release: 18%{?dist} Summary: Argument type classification License: GPL+ or Artistic Group: Development/Libraries URL: http://search.cpan.org/dist/Params-Classify/ Source0: http://www.cpan.org/authors/id/Z/ZE/ZEFRAM/Params-Classify-%{version}.tar.gz +# Restore compatibility with Perl 5.26.0, CPAN RT#114490, patch from +# +Patch0: Params-Classify-0.013-Fix-5.25-or-5.22-24-with-PERL_OP_PARENT.patch BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl(ExtUtils::ParseXS) >= 2.2006 @@ -30,6 +33,7 @@ functions in C++). %prep %setup -q -n Params-Classify-%{version} +%patch0 -p1 %build %{__perl} Build.PL installdirs=vendor optimize="%{optflags}" @@ -53,6 +57,9 @@ find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null \; %{_mandir}/man3/* %changelog +* Mon May 22 2017 Petr Pisar - 0.013-18 +- Restore compatibility with Perl 5.26.0 (CPAN RT#114490) + * Sat Feb 11 2017 Fedora Release Engineering - 0.013-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild