Skip Menu |

This queue is for tickets about the Data-Alias CPAN distribution.

Report information
The Basics
Id: 98758
Status: resolved
Priority: 0/
Queue: Data-Alias

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc: ether [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Lo, a [PATCH] for perl 5.21.4
Subject: open_xaPo5ljv.txt
--- Data-Alias-1.18-orig/Alias.xs 2013-09-21 08:02:59.000000000 -0700 +++ Data-Alias-1.18-hsUEy_/Alias.xs 2014-09-10 08:15:07.000000000 -0700 @@ -1800,6 +1800,7 @@ STATIC void da_peep2(pTHX_ OP *o) { useful = o->op_private & OPpUSEFUL; op_null(o); o->op_ppaddr = PL_ppaddr[OP_NULL]; + cLISTOPo->op_last = cUNOPx(cLISTOPo->op_first)->op_first; k = o = cLISTOPo->op_first; while ((sib = k->op_sibling)) k = sib; @@ -1900,8 +1901,9 @@ STATIC OP *da_ck_rv2cv(pTHX_ OP *o) { if ((PL_nexttype[PL_nexttoke++] = yylex()) == '{') { PL_nexttype[PL_nexttoke++] = DO; sv_setpv((SV *) cv, "$"); - if (PERL_COMBI_VERSION >= 5011002 && - *PL_bufptr == '(') { + if ((PERL_COMBI_VERSION >= 5011002 && + *PL_bufptr == '(') + || PERL_COMBI_VERSION >= 5021004) { /* * A paren here triggers special lexer * behaviour for a parenthesised argument @@ -1910,6 +1912,10 @@ STATIC OP *da_ck_rv2cv(pTHX_ OP *o) { * Suppress it by injecting a semicolon, * which is otherwise a no-op coming just * after the opening brace of a block. + * Also inject the semicolon for 5.21.4 + * and higher, because our setting of + * PL_expect is undone, as PL_lex_expect + * is not used any more. */ Move(PL_bufptr, PL_bufptr+1, PL_bufend+1-PL_bufptr, char); @@ -1920,7 +1926,9 @@ STATIC OP *da_ck_rv2cv(pTHX_ OP *o) { } if(PL_lex_state != LEX_KNOWNEXT) { PL_lex_defer = PL_lex_state; +#if PERL_COMBI_VERSION < 5021004 PL_lex_expect = PL_expect; +#endif PL_lex_state = LEX_KNOWNEXT; } PL_yylval = yylval;
On 2014-09-10 11:18:34, SPROUT wrote: Show quoted text
> --- Data-Alias-1.18-orig/Alias.xs 2013-09-21 08:02:59.000000000 -0700 > +++ Data-Alias-1.18-hsUEy_/Alias.xs 2014-09-10 08:15:07.000000000 -0700 > @@ -1800,6 +1800,7 @@ STATIC void da_peep2(pTHX_ OP *o) { > useful = o->op_private & OPpUSEFUL; > op_null(o); > o->op_ppaddr = PL_ppaddr[OP_NULL]; > + cLISTOPo->op_last = cUNOPx(cLISTOPo->op_first)->op_first; > k = o = cLISTOPo->op_first; > while ((sib = k->op_sibling)) > k = sib; > @@ -1900,8 +1901,9 @@ STATIC OP *da_ck_rv2cv(pTHX_ OP *o) { > if ((PL_nexttype[PL_nexttoke++] = yylex()) == '{') { > PL_nexttype[PL_nexttoke++] = DO; > sv_setpv((SV *) cv, "$"); > - if (PERL_COMBI_VERSION >= 5011002 && > - *PL_bufptr == '(') { > + if ((PERL_COMBI_VERSION >= 5011002 && > + *PL_bufptr == '(') > + || PERL_COMBI_VERSION >= 5021004) { > /* > * A paren here triggers special lexer > * behaviour for a parenthesised argument > @@ -1910,6 +1912,10 @@ STATIC OP *da_ck_rv2cv(pTHX_ OP *o) { > * Suppress it by injecting a semicolon, > * which is otherwise a no-op coming just > * after the opening brace of a block. > + * Also inject the semicolon for 5.21.4 > + * and higher, because our setting of > + * PL_expect is undone, as PL_lex_expect > + * is not used any more. > */ > Move(PL_bufptr, PL_bufptr+1, > PL_bufend+1-PL_bufptr, char); > @@ -1920,7 +1926,9 @@ STATIC OP *da_ck_rv2cv(pTHX_ OP *o) { > } > if(PL_lex_state != LEX_KNOWNEXT) { > PL_lex_defer = PL_lex_state; > +#if PERL_COMBI_VERSION < 5021004 > PL_lex_expect = PL_expect; > +#endif > PL_lex_state = LEX_KNOWNEXT; > } > PL_yylval = yylval;
Unfortunately this patch does not help, I am getting still errors with perl 5.21.4: Applying 1 patch: /usr/local/src/CPAN/sources/authors/id/S/SR/SREZIC/patches/Data-Alias-1.18-RT98758.patch /usr/bin/patch -N -p1 Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |--- Data-Alias-1.18-orig/Alias.xs 2013-09-21 08:02:59.000000000 -0700 |+++ Data-Alias-1.18-hsUEy_/Alias.xs 2014-09-10 08:15:07.000000000 -0700 -------------------------- Patching file Alias.xs using Plan A... Hunk #1 succeeded at 1800. Hunk #2 succeeded at 1901. Hunk #3 succeeded at 1912. Hunk #4 succeeded at 1926. done ... Running make test ... t/01_deref.t ............. Can't load '/usr/local/src/CPAN/build/Data-Alias-1.18-kXv8Jx/blib/arch/auto/Data/Alias/Alias.so' for module Data::Alias: /usr/local/src/CPAN/build/Data-Alias-1.18-kXv8Jx/blib/arch/auto/Data/Alias/Alias.so: Undefined symbol "IS_PADGV" at /usr/perl5.21.4/lib/5.21.4/amd64-freebsd/DynaLoader.pm line 193. at t/01_deref.t line 8. Compilation failed in require at t/01_deref.t line 8. BEGIN failed--compilation aborted at t/01_deref.t line 8. ...
On Tue Oct 07 16:39:18 2014, SREZIC wrote: Show quoted text
> Unfortunately this patch does not help, I am getting still errors with > perl 5.21.4:
Due to more bleadperl changes. Here is an updated patch. It makes B::Concise output less helpful by changing an op type to OP_CUSTOM to dodge new assertions in bleadperl. I didn’t register the custom op, so this patch is less than ideal. But it works. I am working on lvalue references, which I hope to include in perl 5.21.5. Then Data::Alias could be reworked to use perl’s built-in support when available, and most of the hacks in it could be #ifdeffed away for newer perls.
Subject: updated-patch.txt
diff -rup Data-Alias-1.18-DKDJpK-orig/Alias.xs Data-Alias-1.18-DKDJpK/Alias.xs --- Data-Alias-1.18-DKDJpK-orig/Alias.xs 2013-09-21 08:02:59.000000000 -0700 +++ Data-Alias-1.18-DKDJpK/Alias.xs 2014-10-09 08:28:31.000000000 -0700 @@ -133,6 +133,10 @@ #define op_lvalue(o, t) mod(o, t) #endif +#ifndef IS_PADGV +#define IS_PADGV(x) 0 +#endif + #define DA_HAVE_OP_PADRANGE (PERL_COMBI_VERSION >= 5017006) #if DA_HAVE_OP_PADRANGE @@ -1704,6 +1708,7 @@ STATIC int da_transform(pTHX_ OP *op, in break; case OP_AASSIGN: op->op_ppaddr = DataAlias_pp_aassign; + op->op_type = OP_CUSTOM; da_aassign(op, kid); MOD(kid); ksib = FALSE; @@ -1800,6 +1805,7 @@ STATIC void da_peep2(pTHX_ OP *o) { useful = o->op_private & OPpUSEFUL; op_null(o); o->op_ppaddr = PL_ppaddr[OP_NULL]; + cLISTOPo->op_last = cUNOPx(cLISTOPo->op_first)->op_first; k = o = cLISTOPo->op_first; while ((sib = k->op_sibling)) k = sib; @@ -1859,7 +1865,9 @@ STATIC OP *da_ck_rv2cv(pTHX_ OP *o) { return o; /* not lexing? */ kid = cUNOPo->op_first; if (kid->op_type != OP_GV || !DA_ACTIVE || ( - (cv = GvCV(kGVOP_gv)) != da_cv && cv != da_cvc )) + (cv = SvROK(kGVOP_gv) + ? (CV *)SvRV(kGVOP_gv) + : GvCV(kGVOP_gv)) != da_cv && cv != da_cvc )) return o; if (o->op_private & OPpENTERSUB_AMPER) return o; @@ -1900,8 +1908,9 @@ STATIC OP *da_ck_rv2cv(pTHX_ OP *o) { if ((PL_nexttype[PL_nexttoke++] = yylex()) == '{') { PL_nexttype[PL_nexttoke++] = DO; sv_setpv((SV *) cv, "$"); - if (PERL_COMBI_VERSION >= 5011002 && - *PL_bufptr == '(') { + if ((PERL_COMBI_VERSION >= 5011002 && + *PL_bufptr == '(') + || PERL_COMBI_VERSION >= 5021004) { /* * A paren here triggers special lexer * behaviour for a parenthesised argument @@ -1910,6 +1919,10 @@ STATIC OP *da_ck_rv2cv(pTHX_ OP *o) { * Suppress it by injecting a semicolon, * which is otherwise a no-op coming just * after the opening brace of a block. + * Also inject the semicolon for 5.21.4 + * and higher, because our setting of + * PL_expect is undone, as PL_lex_expect + * is not used any more. */ Move(PL_bufptr, PL_bufptr+1, PL_bufend+1-PL_bufptr, char); @@ -1920,7 +1933,9 @@ STATIC OP *da_ck_rv2cv(pTHX_ OP *o) { } if(PL_lex_state != LEX_KNOWNEXT) { PL_lex_defer = PL_lex_state; +#if PERL_COMBI_VERSION < 5021004 PL_lex_expect = PL_expect; +#endif PL_lex_state = LEX_KNOWNEXT; } PL_yylval = yylval;
On Thu Oct 09 15:33:24 2014, SPROUT wrote: Show quoted text
> On Tue Oct 07 16:39:18 2014, SREZIC wrote:
> > Unfortunately this patch does not help, I am getting still errors > > with > > perl 5.21.4:
> > Due to more bleadperl changes. > > Here is an updated patch. It makes B::Concise output less helpful by > changing an op type to OP_CUSTOM to dodge new assertions in bleadperl. > I didn’t register the custom op, so this patch is less than ideal. > But it works.
As of blead commit e2a5b7204, it should be possible to omit the op_type=OP_CUSTOM assignment from that patch, but I have not actually tested it.
On 2014-10-09 15:33:24, SPROUT wrote: Show quoted text
> On Tue Oct 07 16:39:18 2014, SREZIC wrote:
> > Unfortunately this patch does not help, I am getting still errors > > with > > perl 5.21.4:
> > Due to more bleadperl changes. > > Here is an updated patch. It makes B::Concise output less helpful by > changing an op type to OP_CUSTOM to dodge new assertions in bleadperl. > I didn’t register the custom op, so this patch is less than ideal. > But it works. > > I am working on lvalue references, which I hope to include in perl > 5.21.5. Then Data::Alias could be reworked to use perl’s built-in > support when available, and most of the hacks in it could be #ifdeffed > away for newer perls.
This patch works for me (tested with 5.21.5). For anybody who needs this: an updated distroprefs for CPAN.pm is available at git://github.com/eserte/srezic-cpan-distroprefs.git
On 2014-11-19 17:44:08, SREZIC wrote: Show quoted text
> On 2014-10-09 15:33:24, SPROUT wrote:
> > On Tue Oct 07 16:39:18 2014, SREZIC wrote:
> > > Unfortunately this patch does not help, I am getting still errors > > > with > > > perl 5.21.4:
> > > > Due to more bleadperl changes. > > > > Here is an updated patch. It makes B::Concise output less helpful by > > changing an op type to OP_CUSTOM to dodge new assertions in > > bleadperl. > > I didn’t register the custom op, so this patch is less than ideal. > > But it works. > > > > I am working on lvalue references, which I hope to include in perl > > 5.21.5. Then Data::Alias could be reworked to use perl’s built-in > > support when available, and most of the hacks in it could be > > #ifdeffed > > away for newer perls.
> > This patch works for me (tested with 5.21.5). For anybody who needs > this: an updated distroprefs for CPAN.pm is available at > git://github.com/eserte/srezic-cpan-distroprefs.git
Patch is still needed for perl 5.21.10.
On 2015-03-20 16:12:39, SREZIC wrote: Show quoted text
> On 2014-11-19 17:44:08, SREZIC wrote:
> > On 2014-10-09 15:33:24, SPROUT wrote:
> > > On Tue Oct 07 16:39:18 2014, SREZIC wrote:
> > > > Unfortunately this patch does not help, I am getting still errors > > > > with > > > > perl 5.21.4:
> > > > > > Due to more bleadperl changes. > > > > > > Here is an updated patch. It makes B::Concise output less helpful by > > > changing an op type to OP_CUSTOM to dodge new assertions in > > > bleadperl. > > > I didn’t register the custom op, so this patch is less than ideal. > > > But it works. > > > > > > I am working on lvalue references, which I hope to include in perl > > > 5.21.5. Then Data::Alias could be reworked to use perl’s built-in > > > support when available, and most of the hacks in it could be > > > #ifdeffed > > > away for newer perls.
> > > > This patch works for me (tested with 5.21.5). For anybody who needs > > this: an updated distroprefs for CPAN.pm is available at > > git://github.com/eserte/srezic-cpan-distroprefs.git
> > Patch is still needed for perl 5.21.10.
Now with perl 5.21.11 it looks different: even with the patch the compilation fails: cc -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2 -DVERSION=\"1.18\" -DXS_VERSION=\"1.18\" -fPIC "-I/opt/perl-5.21.11/lib/5.21.11/x86_64-linux/CORE" Alias.c Alias.xs: In function 'da_ck_entersub': Alias.xs:2039:5: error: 'OP' has no member named 'op_lastsib' make: *** [Alias.o] Error 1
On 2015-04-20 18:52:31, SREZIC wrote: Show quoted text
> On 2015-03-20 16:12:39, SREZIC wrote:
> > On 2014-11-19 17:44:08, SREZIC wrote:
> > > On 2014-10-09 15:33:24, SPROUT wrote:
> > > > On Tue Oct 07 16:39:18 2014, SREZIC wrote:
> > > > > Unfortunately this patch does not help, I am getting still > > > > > errors > > > > > with > > > > > perl 5.21.4:
> > > > > > > > Due to more bleadperl changes. > > > > > > > > Here is an updated patch. It makes B::Concise output less > > > > helpful by > > > > changing an op type to OP_CUSTOM to dodge new assertions in > > > > bleadperl. > > > > I didn’t register the custom op, so this patch is less than > > > > ideal. > > > > But it works. > > > > > > > > I am working on lvalue references, which I hope to include in > > > > perl > > > > 5.21.5. Then Data::Alias could be reworked to use perl’s built- > > > > in > > > > support when available, and most of the hacks in it could be > > > > #ifdeffed > > > > away for newer perls.
> > > > > > This patch works for me (tested with 5.21.5). For anybody who needs > > > this: an updated distroprefs for CPAN.pm is available at > > > git://github.com/eserte/srezic-cpan-distroprefs.git
> > > > Patch is still needed for perl 5.21.10.
> > Now with perl 5.21.11 it looks different: even with the patch the > compilation fails: > > cc -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector > -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 > -D_FORTIFY_SOURCE=2 -O2 -DVERSION=\"1.18\" -DXS_VERSION=\"1.18\" > -fPIC "-I/opt/perl-5.21.11/lib/5.21.11/x86_64-linux/CORE" Alias.c > Alias.xs: In function 'da_ck_entersub': > Alias.xs:2039:5: error: 'OP' has no member named 'op_lastsib' > make: *** [Alias.o] Error 1
Attached another patch which is hopefully fixing this problem. (The other patches are still needed for perl 5.21.11)
Subject: 0001-op_lastsib-was-changed-to-op_moresib-in-perl-5.21.11.patch
From f159700fedd4f99a12c5dc78be9123be6136ed8f Mon Sep 17 00:00:00 2001 From: Slaven Rezic <slaven@rezic.de> Date: Tue, 21 Apr 2015 21:37:57 +0200 Subject: [PATCH] op_lastsib was changed to op_moresib in perl 5.21.11 --- Alias.xs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Alias.xs b/Alias.xs index 2731c29..209aeb7 100644 --- a/Alias.xs +++ b/Alias.xs @@ -2036,8 +2036,12 @@ STATIC OP *da_ck_entersub(pTHX_ OP *o) { kid = kid->op_sibling; kid->op_sibling = Nullop; #ifdef op_sibling_splice +#if (PERL_COMBI_VERSION >= 5021011) + kid->op_moresib = 0; +#else kid->op_lastsib = 1; #endif +#endif cLISTOPx(cUNOPo->op_first)->op_last = kid; if (kid->op_type == OP_NULL && inside) kid->op_flags &= ~OPf_SPECIAL; -- 2.1.2
Fixed in Data-Alias-1.19, now on CPAN.