diff -rup Array-Base-0.005-PztWfA-orig/lib/Array/Base.xs Array-Base-0.005-PztWfA/lib/Array/Base.xs
--- Array-Base-0.005-PztWfA-orig/lib/Array/Base.xs 2014-09-27 11:17:23.000000000 -0700
+++ Array-Base-0.005-PztWfA/lib/Array/Base.xs 2014-09-27 11:29:40.000000000 -0700
@@ -87,6 +87,7 @@ static OP *myck_aelem(pTHX_ OP *op)
IV base;
if((base = current_base()) != 0) {
OP *aop, *iop;
+ OP *newsib;
if(!(op->op_flags & OPf_KIDS)) {
bad_ops:
croak("strange op tree prevents applying array base");
@@ -94,11 +95,20 @@ static OP *myck_aelem(pTHX_ OP *op)
aop = cBINOPx(op)->op_first;
iop = aop->op_sibling;
if(!iop || iop->op_sibling) goto bad_ops;
+#ifdef op_sibling_splice
+ op_sibling_splice(op, aop, 0,
+ op_contextualize(
+ newBINOP(OP_I_SUBTRACT, 0,
+ op_sibling_splice(op,aop,1,NULL),
+ newSVOP(OP_CONST, 0, newSViv(base))),
+ G_SCALAR));
+#else
aop->op_sibling =
op_contextualize(
newBINOP(OP_I_SUBTRACT, 0, iop,
newSVOP(OP_CONST, 0, newSViv(base))),
G_SCALAR);
+#endif
}
return nxck_aelem(aTHX_ op);
}
@@ -116,11 +126,22 @@ static OP *THX_base_myck_slice(pTHX_ OP
lop = cLISTOPx(op)->op_first;
aop = lop->op_sibling;
if(!aop || aop->op_sibling) goto bad_ops;
+#ifdef op_sibling_splice
+ op_sibling_splice(op, NULL, 0,
+ op_contextualize(mapify_op(
+ op_sibling_splice(
+ op, NULL,
+ 1, NULL),
+ base,
+ OP_I_SUBTRACT),
+ G_ARRAY));
+#else
lop->op_sibling = NULL;
mop = op_contextualize(mapify_op(lop, base, OP_I_SUBTRACT),
G_ARRAY);
mop->op_sibling = aop;
cLISTOPx(op)->op_first = mop;
+#endif
}
return nxck(aTHX_ op);
}
@@ -160,6 +181,18 @@ static OP *myck_splice(pTHX_ OP *op)
if(!aop) goto bad_ops;
iop = aop->op_sibling;
if(iop) {
+#ifdef op_sibling_splice
+ op_sibling_splice(op, aop, 0,
+ newBINOP(OP_I_SUBTRACT, 0,
+ op_contextualize(
+ op_sibling_splice(
+ op, aop, 1,
+ NULL),
+ G_SCALAR),
+ newSVOP(OP_CONST, 0,
+ newSViv(base)))
+ );
+#else
OP *rest = iop->op_sibling;
iop->op_sibling = NULL;
iop = newBINOP(OP_I_SUBTRACT, 0,
@@ -167,6 +200,7 @@ static OP *myck_splice(pTHX_ OP *op)
newSVOP(OP_CONST, 0, newSViv(base)));
iop->op_sibling = rest;
aop->op_sibling = iop;
+#endif
}
}
return nxck_splice(aTHX_ op);