Subject: | [PATCH] Fix for PADNAMELIST changes |
See https://rt.perl.org/Ticket/Display.html?id=123518 and the attached. I have only tested the patch with 5.21.8, but I believe it will work with the latest blead.
Subject: | open_KEBkXagJ.txt |
diff -rup Eval-Compile-0.11-Qwc8b9-orig/Compile.xs Eval-Compile-0.11-Qwc8b9/Compile.xs
--- Eval-Compile-0.11-Qwc8b9-orig/Compile.xs 2012-09-14 05:28:26.000000000 -0700
+++ Eval-Compile-0.11-Qwc8b9/Compile.xs 2015-03-25 01:07:47.000000000 -0700
@@ -55,6 +55,7 @@ typedef AV PAD;
#define AvPUSHi( av, sv ) my_av_pushi( aTHX_ av, sv )
#define AvPUSHpnv( av, p, n ) my_av_pushi( aTHX_ av, p, n )
#define AvELT( av, n ) (AvARRAY( av )[n])
+#define PnlELT( pnl, n ) (PadnamelistARRAY( pnl )[n])
#define M_alloc( pad, size) (my_memory_alloc( aTHX_ pad, size) )
void
@@ -151,7 +152,7 @@ find_sv( CV * cv, I32 cv_depth, U32 cop_
padname = PadlistNAMES(pad);
for ( i=0; i<=PadMAX( padval ); ++i){
if ( PadARRAY( padval )[i] == val ){
- if ( PadnameOUTER(AvELT( padname, i))){
+ if ( PadnameOUTER(PnlELT( padname, i))){
// fprintf( stderr, "==!!!===%d\n", i);
return -2;
}
@@ -249,10 +250,10 @@ void cl_init( pTHX_ p_closure cl, AV*tem
cl->offset_size = 0;
- for (i=0; i<= AvFILLp( names ) ; ++i ){
+ for (i=0; i<= PadnamelistMAX( names ) ; ++i ){
PADNAME *name_sv;
SV *val_sv;
- name_sv = (AvARRAY(names)[i]);
+ name_sv = PnlELT(names, i);
val_sv = AvARRAY( values )[i];
if ( PadnamePV(name_sv) && PadnameOUTER(name_sv)
&& !PadnameIsOUR(name_sv)