Skip Menu |

This queue is for tickets about the Array-Base CPAN distribution.

Report information
The Basics
Id: 117385
Status: resolved
Priority: 0/
Queue: Array-Base

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: Compilation error with perl 5.25.x (op_sibling)
Compilation fails with bleadperl (e.g. perl 5.25.4): cc -I/opt/perl-5.25.4/lib/5.25.4/x86_64-linux/CORE -DVERSION="0.005" -DXS_VERSION="0.005" -fPIC -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2 -o lib/Array/Base.o lib/Array/Base.c lib/Array/Base.xs: In function ‘myck_aelem’: lib/Array/Base.xs:95:12: error: ‘OP’ has no member named ‘op_sibling’ iop = aop->op_sibling; ^ lib/Array/Base.xs:96:17: error: ‘OP’ has no member named ‘op_sibling’ if(!iop || iop->op_sibling) goto bad_ops; ^ (etc.) Related ticket: https://rt.perl.org/Ticket/Display.html?id=128179 Maybe related: https://rt.cpan.org/Ticket/Display.html?id=99179
From: ppisar [...] redhat.com
Dne St 31.srp.2016 19:16:21, SREZIC napsal(a): Show quoted text
> Compilation fails with bleadperl (e.g. perl 5.25.4): > > cc -I/opt/perl-5.25.4/lib/5.25.4/x86_64-linux/CORE -DVERSION="0.005" > -DXS_VERSION="0.005" -fPIC -c -fwrapv -fno-strict-aliasing -pipe > -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE > -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2 -o lib/Array/Base.o > lib/Array/Base.c > lib/Array/Base.xs: In function ‘myck_aelem’: > lib/Array/Base.xs:95:12: error: ‘OP’ has no member named > ‘op_sibling’ > iop = aop->op_sibling; > ^
I tried the attached code, but any tests hang. Probably I created a cycle in the op tree.
Subject: 0001-Fix-building-on-Perl-5.25.1.patch
From 0610fc509ae2826140209bbcd3efe5003d132f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Mon, 22 May 2017 16:12:55 +0200 Subject: [PATCH] Fix building on Perl 5.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v5.25.0-71-g5d32d26 enabled PERL_OP_PARENT and that changed op_sibling semantics for last sibling OP. This patch implements a fix as recommended in <https://rt.perl.org/Public/Bug/Display.html?id=128179#txn-1405910>. It also bundles ppport.h CPAN RT#117385 Signed-off-by: Petr Písař <ppisar@redhat.com> --- lib/Array/Base.xs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/Array/Base.xs b/lib/Array/Base.xs index 91bc7b5..13db507 100644 --- a/lib/Array/Base.xs +++ b/lib/Array/Base.xs @@ -2,6 +2,7 @@ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" +#include "ppport.h" #define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s) #define PERL_DECIMAL_VERSION \ @@ -92,13 +93,12 @@ static OP *myck_aelem(pTHX_ OP *op) croak("strange op tree prevents applying array base"); } aop = cBINOPx(op)->op_first; - iop = aop->op_sibling; - if(!iop || iop->op_sibling) goto bad_ops; - aop->op_sibling = - op_contextualize( + iop = OpSIBLING(aop); + if(!iop || OpHAS_SIBLING(iop)) goto bad_ops; + OpMAYBESIB_set(aop, op_contextualize( newBINOP(OP_I_SUBTRACT, 0, iop, newSVOP(OP_CONST, 0, newSViv(base))), - G_SCALAR); + G_SCALAR), op); } return nxck_aelem(aTHX_ op); } @@ -114,12 +114,12 @@ static OP *THX_base_myck_slice(pTHX_ OP *op, OP *(*nxck)(pTHX_ OP *o)) croak("strange op tree prevents applying array base"); } lop = cLISTOPx(op)->op_first; - aop = lop->op_sibling; - if(!aop || aop->op_sibling) goto bad_ops; - lop->op_sibling = NULL; + aop = OpSIBLING(lop); + if(!aop || OpHAS_SIBLING(aop)) goto bad_ops; + OpLASTSIB_set(lop, op); mop = op_contextualize(mapify_op(lop, base, OP_I_SUBTRACT), G_ARRAY); - mop->op_sibling = aop; + OpMAYBESIB_set(mop, aop, op); cLISTOPx(op)->op_first = mop; } return nxck(aTHX_ op); @@ -156,17 +156,17 @@ static OP *myck_splice(pTHX_ OP *op) } pop = cLISTOPx(op)->op_first; if(pop->op_type != OP_PUSHMARK) goto bad_ops; - aop = pop->op_sibling; + aop = OpSIBLING(pop); if(!aop) goto bad_ops; - iop = aop->op_sibling; + iop = OpSIBLING(aop); if(iop) { - OP *rest = iop->op_sibling; - iop->op_sibling = NULL; + OP *rest = OpSIBLING(iop); + OpLASTSIB_set(iop, op); iop = newBINOP(OP_I_SUBTRACT, 0, op_contextualize(iop, G_SCALAR), newSVOP(OP_CONST, 0, newSViv(base))); - iop->op_sibling = rest; - aop->op_sibling = iop; + OpMAYBESIB_set(iop, rest, op); + OpMAYBESIB_set(aop, iop, op); } } return nxck_splice(aTHX_ op); -- 2.9.4
From: ppisar [...] redhat.com
Dne Po 22.Květen.2017 11:52:19, ppisar napsal(a): Show quoted text
> I tried the attached code, but any tests hang. Probably I created a > cycle in the op tree.
The problem was a side effect by evaluating a macro argument multiple times. A working fix is attached.
Subject: Array-Base-0.005-Fix-building-on-Perl-5.25.1.patch

Message body is not shown because it is too large.

Fixed in Array-Base-0.006, just uploaded to CPAN.