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.
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;