Skip Menu |

This queue is for tickets about the Eval-Compile CPAN distribution.

Report information
The Basics
Id: 79153
Status: resolved
Worked: 1 min
Priority: 0/
Queue: Eval-Compile

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

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



Subject: [PATCH] Pad changes in 5.17.4-to-be
This module no longer compiles with bleadperl. Attached is a patch. See http://perl5.git.perl.org/perl.git/commitdiff/86b9d29366 and http://perl5.git.perl.org/perl.git/commitdiff/35e035ccb for more information.
Subject: open_uCzjUK3j.txt
diff -rup Eval-Compile-0.10-j8v_qy/Compile.xs Eval-Compile-0.10-raBUMW/Compile.xs --- Eval-Compile-0.10-j8v_qy/Compile.xs 2010-12-13 06:33:15.000000000 -0800 +++ Eval-Compile-0.10-raBUMW/Compile.xs 2012-08-22 18:03:35.000000000 -0700 @@ -22,6 +22,27 @@ # define COP_SEQ_RANGE_HIGH(sv) U_32(SvUVX(sv)) #endif +#ifndef PAD_ARRAY +typedef AV PADNAMELIST; +typedef SV PADNAME; +# if PERL_VERSION < 9 +typedef AV PADLIST; +typedef AV PAD; +# endif +# define PADLIST_ARRAY AvARRAY +# define PADLIST_NAMES(pl) (*PADLIST_ARRAY(pl)) +# define PADNAMELIST_ARRAY AvARRAY +# define PADNAMELIST_MAX AvFILLp +# define PAD_ARRAY AvARRAY +# define PAD_MAX AvFILLp +# define PADNAME_PV(pn) (SvPOKp(pn) ? SvPVX(pn) : NULL) +# define PADNAME_LEN(pn) SvCUR(pn) +# define PADNAME_isOUR(pn) !!(SvFLAGS(pn) & SVpad_OUR) +# define PADNAME_OUTER(pn) !!SvFAKE(pn) +# define PADNAME_SV(pn) pn +#endif + + /* For development testing */ #ifdef PADWALKER_DEBUGGING @@ -65,10 +86,10 @@ my_av_pushpvn( pTHX_ AV *av, char *p, ST void _show_cvpad( CV *cv ){ if ( cv && CvPADLIST( cv ) ){ - AV *padlist = CvPADLIST( cv ); - AV * padnames = (AV *)(AvARRAY(padlist)[0]); + PADLIST *padlist = CvPADLIST( cv ); + PADNAMELIST * padnames = PADLIST_NAMES(padlist); I32 i; - I32 namefill = AvFILLp( padnames ); + I32 namefill = PADNAMELIST_MAX( padnames ); CV *cvout; if ( PL_DBsub && cv == GvCV(PL_DBsub) ){ fprintf( stderr, " DB::sub"); @@ -83,12 +104,13 @@ void _show_cvpad( CV *cv ){ cvout = CvOUTSIDE( cvout ); } while( cvout ); for(i=0; i<=namefill; ++i){ - SV *name_sv; + PADNAME *name_sv; STRLEN name_len; - name_sv = AvARRAY( padnames )[i]; - if (name_sv && SvPOKp(name_sv) && ( name_len = SvCUR(name_sv)) > 1) { - char* name_str = SvPVX(name_sv); - bool is_my = ((SvFLAGS(name_sv) & SVpad_OUR) == 0); + name_sv = PADNAMELIST_ARRAY( padnames )[i]; + if (name_sv && PADNAME_PV(name_sv) + && ( name_len = PADNAME_LEN(name_sv)) > 1) { + char* name_str = PADNAME_PV(name_sv); + bool is_my = !PADNAME_isOUR(name_sv); if ( is_my ) { fprintf( stderr, " %s(%d,%d)", name_str, COP_SEQ_RANGE_LOW(name_sv), COP_SEQ_RANGE_HIGH(name_sv) ); } @@ -99,10 +121,10 @@ void _show_cvpad( CV *cv ){ typedef struct my_closure{ CV *closure_cv; - AV **closure_pad; + PAD **closure_pad; long stack_depth; CV *outer; - AV **outer_pad; + PAD **outer_pad; I32 outer_depth; I32 offset_size; I32 *position; @@ -119,17 +141,17 @@ cl_prepare_closure( pTHX_ p_closure cl, I32 find_sv( CV * cv, I32 cv_depth, U32 cop_seq, SV *val ){ I32 i; - AV *pad; - AV *padval; - AV *padname; + PADLIST *pad; + PAD *padval; + PADNAMELIST *padname; pad= CvPADLIST( cv ); if (!pad) return -1; - padval = (AV *)AvARRAY( pad )[cv_depth]; - padname = (AV *)AvARRAY( pad )[0]; - for ( i=0; i<=AvFILLp( padval ); ++i){ - if ( AvARRAY( padval )[i] == val ){ - if ( SvFAKE(AvELT( padname, i))){ + padval = PADLIST_ARRAY( pad )[cv_depth]; + padname = PADLIST_NAMES(pad); + for ( i=0; i<=PAD_MAX( padval ); ++i){ + if ( PAD_ARRAY( padval )[i] == val ){ + if ( PADNAME_OUTER(AvELT( padname, i))){ // fprintf( stderr, "==!!!===%d\n", i); return -2; } @@ -148,15 +170,15 @@ void cl_init( pTHX_ p_closure cl, AV*tem U32 context_seq; CV *curcv; I32 curcv_depth; - AV *names; - AV *values; + PADNAMELIST *names; + PAD *values; long stack_depth; int i; bool context_match; if ( ! cl->ok ) return; if (cv && CvPADLIST( cv ) ){ - AV *padlist = CvPADLIST( cv ); + PADLIST *padlist = CvPADLIST( cv ); if (CvDEPTH(cv)){ croak( "Fail compile: cv is running" ); } @@ -202,16 +224,16 @@ void cl_init( pTHX_ p_closure cl, AV*tem if ( ! CvPADLIST( curcv )) return; - names = (AV *)(AvARRAY(padlist)[0]); - values =(AV *)(AvARRAY(padlist)[1]); - for (i=0; i<= AvFILLp( names ) ; ++i ){ - SV *name_sv; + names = PADLIST_NAMES(padlist); + values =PADLIST_ARRAY(padlist)[1]; + for (i=0; i<= PADNAMELIST_MAX( names ) ; ++i ){ + PADNAME *name_sv; SV *val_sv; - name_sv = (AvARRAY(names)[i]); - val_sv = AvARRAY( values )[i]; - if ( SvPOKp(name_sv) && SvFAKE(name_sv) - && 0 == (SvFLAGS(name_sv) & SVpad_OUR ) - && SvCUR(name_sv) > 1 ){ + name_sv = (PADNAMELIST_ARRAY(names)[i]); + val_sv = PAD_ARRAY( values )[i]; + if ( PADNAME_PV(name_sv) && PADNAME_OUTER(name_sv) + && !PADNAME_isOUR(name_sv) + && PADNAME_LEN(name_sv) > 1 ){ ++(cl->offset_size); } } @@ -228,13 +250,13 @@ void cl_init( pTHX_ p_closure cl, AV*tem cl->offset_size = 0; for (i=0; i<= AvFILLp( names ) ; ++i ){ - SV *name_sv; + PADNAME *name_sv; SV *val_sv; name_sv = (AvARRAY(names)[i]); val_sv = AvARRAY( values )[i]; - if ( SvPOKp(name_sv) && SvFAKE(name_sv) - && 0 == (SvFLAGS(name_sv) & SVpad_OUR ) - && SvCUR(name_sv) > 1 ){ + if ( PADNAME_PV(name_sv) && PADNAME_OUTER(name_sv) + && !PADNAME_isOUR(name_sv) + && PADNAME_LEN(name_sv) > 1 ){ I32 position; position = find_sv( curcv, curcv_depth, context_seq, val_sv); //fprintf( stderr, "%d=\n", position ); @@ -246,8 +268,8 @@ void cl_init( pTHX_ p_closure cl, AV*tem cl->position[ cl->offset_size++] = i; } } - cl->outer_pad =( AV **) AvARRAY( CvPADLIST( curcv )); - cl->closure_pad = ( AV **)AvARRAY( CvPADLIST( cl->closure_cv )); + cl->outer_pad = PADLIST_ARRAY( CvPADLIST( curcv )); + cl->closure_pad = PADLIST_ARRAY( CvPADLIST( cl->closure_cv )); cl_prepare_closure( aTHX_ cl, 0 ); //fprintf( stderr, "\n"); } @@ -258,8 +280,8 @@ cl_prepare_closure( pTHX_ p_closure cl, I32 i; I32 j; I32 cv_depth = cl->outer_depth; - SV **out_values = AvARRAY(cl->outer_pad[cv_depth]); - SV **closure_values = AvARRAY(cl->closure_pad[1]); + SV **out_values = PAD_ARRAY(cl->outer_pad[cv_depth]); + SV **closure_values = PAD_ARRAY(cl->closure_pad[1]); if ( !cl->ok ) return; @@ -545,8 +567,8 @@ void callers( CV * cv, SV *eval_string ) PREINIT: int i; - AV *names; - AV *values; + PADNAMELIST *names; + PAD *values; CV *subcv; long subcv_depth; long stack_depth; @@ -555,7 +577,7 @@ callers( CV * cv, SV *eval_string ) AV *results; PPCODE: if (cv && CvPADLIST( cv ) ){ - AV *padlist = CvPADLIST( cv ); + PADLIST *padlist = CvPADLIST( cv ); if (CvDEPTH(cv)){ croak( "Fail compile: cv is running" ); } @@ -596,18 +618,19 @@ callers( CV * cv, SV *eval_string ) _show_cvpad( cxstack[ stack_depth ].blk_sub.cv ); - names = (AV *)(AvARRAY(padlist)[0]); - values =(AV *)(AvARRAY(padlist)[1]); + names = PADLIST_NAMES(padlist); + values =PADLIST_ARRAY(padlist)[1]; - for (i=0; i<= AvFILLp( names ) ; ++i ){ - SV *name_sv; + for (i=0; i<= PADNAMELIST_MAX( names ) ; ++i ){ + PADNAME *padn; SV *val_sv; - name_sv = (AvARRAY(names)[i]); - val_sv = AvARRAY( values )[i]; - if ( SvPOKp(name_sv) && SvFAKE(name_sv) - && 0 == (SvFLAGS(name_sv) & SVpad_OUR ) - && SvCUR(name_sv) > 1 ){ + padn = (PADNAMELIST_ARRAY(names)[i]); + val_sv = PAD_ARRAY( values )[i]; + if ( PADNAME_PV(padn) && PADNAME_OUTER(padn) + && !PADNAME_isOUR(padn) + && PADNAME_LEN(padn) > 1 ){ I32 position; + SV * const name_sv = PADNAME_SV(padn); XPUSHs(name_sv); mXPUSHi( i ); position = find_sv( subcv, subcv_depth, context_seq, val_sv);
RT-Send-CC: grian [...] cpan.org
Sorry, that first patch was no good. Please try this one.
Subject: open_zkN1xDPD.txt
diff -rup Eval-Compile-0.10-j8v_qy/Compile.xs Eval-Compile-0.10-raBUMW/Compile.xs --- Eval-Compile-0.10-j8v_qy/Compile.xs 2010-12-13 06:33:15.000000000 -0800 +++ Eval-Compile-0.10-raBUMW/Compile.xs 2012-08-22 22:16:05.000000000 -0700 @@ -22,6 +22,27 @@ # define COP_SEQ_RANGE_HIGH(sv) U_32(SvUVX(sv)) #endif +#ifndef PadARRAY +typedef AV PADNAMELIST; +typedef SV PADNAME; +# if PERL_VERSION < 9 +typedef AV PADLIST; +typedef AV PAD; +# endif +# define PadlistARRAY AvARRAY +# define PadlistNAMES(pl) (*PadlistARRAY(pl)) +# define PadnamelistARRAY(pnl) ((PADNAME **)AvARRAY(pnl)) +# define PadnamelistMAX(pnl) AvFILLp(pnl) +# define PadARRAY AvARRAY +# define PadMAX AvFILLp +# define PadnamePV(pn) (SvPOKp(pn) ? SvPVX(pn) : NULL) +# define PadnameLEN(pn) SvCUR(pn) +# define PadnameIsOUR(pn) !!(SvFLAGS(pn) & SVpad_OUR) +# define PadnameOUTER(pn) !!SvFAKE(pn) +# define PadnameSV(pn) pn +#endif + + /* For development testing */ #ifdef PADWALKER_DEBUGGING @@ -65,10 +86,10 @@ my_av_pushpvn( pTHX_ AV *av, char *p, ST void _show_cvpad( CV *cv ){ if ( cv && CvPADLIST( cv ) ){ - AV *padlist = CvPADLIST( cv ); - AV * padnames = (AV *)(AvARRAY(padlist)[0]); + PADLIST *padlist = CvPADLIST( cv ); + PADNAMELIST * padnames = PadlistNAMES(padlist); I32 i; - I32 namefill = AvFILLp( padnames ); + I32 namefill = PadnamelistMAX( padnames ); CV *cvout; if ( PL_DBsub && cv == GvCV(PL_DBsub) ){ fprintf( stderr, " DB::sub"); @@ -83,12 +104,13 @@ void _show_cvpad( CV *cv ){ cvout = CvOUTSIDE( cvout ); } while( cvout ); for(i=0; i<=namefill; ++i){ - SV *name_sv; + PADNAME *name_sv; STRLEN name_len; - name_sv = AvARRAY( padnames )[i]; - if (name_sv && SvPOKp(name_sv) && ( name_len = SvCUR(name_sv)) > 1) { - char* name_str = SvPVX(name_sv); - bool is_my = ((SvFLAGS(name_sv) & SVpad_OUR) == 0); + name_sv = PadnamelistARRAY( padnames )[i]; + if (name_sv && PadnamePV(name_sv) + && ( name_len = PadnameLEN(name_sv)) > 1) { + char* name_str = PadnamePV(name_sv); + bool is_my = !PadnameIsOUR(name_sv); if ( is_my ) { fprintf( stderr, " %s(%d,%d)", name_str, COP_SEQ_RANGE_LOW(name_sv), COP_SEQ_RANGE_HIGH(name_sv) ); } @@ -99,10 +121,10 @@ void _show_cvpad( CV *cv ){ typedef struct my_closure{ CV *closure_cv; - AV **closure_pad; + PAD **closure_pad; long stack_depth; CV *outer; - AV **outer_pad; + PAD **outer_pad; I32 outer_depth; I32 offset_size; I32 *position; @@ -119,17 +141,17 @@ cl_prepare_closure( pTHX_ p_closure cl, I32 find_sv( CV * cv, I32 cv_depth, U32 cop_seq, SV *val ){ I32 i; - AV *pad; - AV *padval; - AV *padname; + PADLIST *pad; + PAD *padval; + PADNAMELIST *padname; pad= CvPADLIST( cv ); if (!pad) return -1; - padval = (AV *)AvARRAY( pad )[cv_depth]; - padname = (AV *)AvARRAY( pad )[0]; - for ( i=0; i<=AvFILLp( padval ); ++i){ - if ( AvARRAY( padval )[i] == val ){ - if ( SvFAKE(AvELT( padname, i))){ + padval = PadlistARRAY( pad )[cv_depth]; + padname = PadlistNAMES(pad); + for ( i=0; i<=PadMAX( padval ); ++i){ + if ( PadARRAY( padval )[i] == val ){ + if ( PadnameOUTER(AvELT( padname, i))){ // fprintf( stderr, "==!!!===%d\n", i); return -2; } @@ -148,15 +170,15 @@ void cl_init( pTHX_ p_closure cl, AV*tem U32 context_seq; CV *curcv; I32 curcv_depth; - AV *names; - AV *values; + PADNAMELIST *names; + PAD *values; long stack_depth; int i; bool context_match; if ( ! cl->ok ) return; if (cv && CvPADLIST( cv ) ){ - AV *padlist = CvPADLIST( cv ); + PADLIST *padlist = CvPADLIST( cv ); if (CvDEPTH(cv)){ croak( "Fail compile: cv is running" ); } @@ -202,16 +224,16 @@ void cl_init( pTHX_ p_closure cl, AV*tem if ( ! CvPADLIST( curcv )) return; - names = (AV *)(AvARRAY(padlist)[0]); - values =(AV *)(AvARRAY(padlist)[1]); - for (i=0; i<= AvFILLp( names ) ; ++i ){ - SV *name_sv; + names = PadlistNAMES(padlist); + values =PadlistARRAY(padlist)[1]; + for (i=0; i<= PadnamelistMAX( names ) ; ++i ){ + PADNAME *name_sv; SV *val_sv; - name_sv = (AvARRAY(names)[i]); - val_sv = AvARRAY( values )[i]; - if ( SvPOKp(name_sv) && SvFAKE(name_sv) - && 0 == (SvFLAGS(name_sv) & SVpad_OUR ) - && SvCUR(name_sv) > 1 ){ + name_sv = (PadnamelistARRAY(names)[i]); + val_sv = PadARRAY( values )[i]; + if ( PadnamePV(name_sv) && PadnameOUTER(name_sv) + && !PadnameIsOUR(name_sv) + && PadnameLEN(name_sv) > 1 ){ ++(cl->offset_size); } } @@ -228,13 +250,13 @@ void cl_init( pTHX_ p_closure cl, AV*tem cl->offset_size = 0; for (i=0; i<= AvFILLp( names ) ; ++i ){ - SV *name_sv; + PADNAME *name_sv; SV *val_sv; name_sv = (AvARRAY(names)[i]); val_sv = AvARRAY( values )[i]; - if ( SvPOKp(name_sv) && SvFAKE(name_sv) - && 0 == (SvFLAGS(name_sv) & SVpad_OUR ) - && SvCUR(name_sv) > 1 ){ + if ( PadnamePV(name_sv) && PadnameOUTER(name_sv) + && !PadnameIsOUR(name_sv) + && PadnameLEN(name_sv) > 1 ){ I32 position; position = find_sv( curcv, curcv_depth, context_seq, val_sv); //fprintf( stderr, "%d=\n", position ); @@ -246,8 +268,8 @@ void cl_init( pTHX_ p_closure cl, AV*tem cl->position[ cl->offset_size++] = i; } } - cl->outer_pad =( AV **) AvARRAY( CvPADLIST( curcv )); - cl->closure_pad = ( AV **)AvARRAY( CvPADLIST( cl->closure_cv )); + cl->outer_pad = PadlistARRAY( CvPADLIST( curcv )); + cl->closure_pad = PadlistARRAY( CvPADLIST( cl->closure_cv )); cl_prepare_closure( aTHX_ cl, 0 ); //fprintf( stderr, "\n"); } @@ -258,8 +280,8 @@ cl_prepare_closure( pTHX_ p_closure cl, I32 i; I32 j; I32 cv_depth = cl->outer_depth; - SV **out_values = AvARRAY(cl->outer_pad[cv_depth]); - SV **closure_values = AvARRAY(cl->closure_pad[1]); + SV **out_values = PadARRAY(cl->outer_pad[cv_depth]); + SV **closure_values = PadARRAY(cl->closure_pad[1]); if ( !cl->ok ) return; @@ -545,8 +567,8 @@ void callers( CV * cv, SV *eval_string ) PREINIT: int i; - AV *names; - AV *values; + PADNAMELIST *names; + PAD *values; CV *subcv; long subcv_depth; long stack_depth; @@ -555,7 +577,7 @@ callers( CV * cv, SV *eval_string ) AV *results; PPCODE: if (cv && CvPADLIST( cv ) ){ - AV *padlist = CvPADLIST( cv ); + PADLIST *padlist = CvPADLIST( cv ); if (CvDEPTH(cv)){ croak( "Fail compile: cv is running" ); } @@ -596,18 +618,19 @@ callers( CV * cv, SV *eval_string ) _show_cvpad( cxstack[ stack_depth ].blk_sub.cv ); - names = (AV *)(AvARRAY(padlist)[0]); - values =(AV *)(AvARRAY(padlist)[1]); + names = PadlistNAMES(padlist); + values =PadlistARRAY(padlist)[1]; - for (i=0; i<= AvFILLp( names ) ; ++i ){ - SV *name_sv; + for (i=0; i<= PadnamelistMAX( names ) ; ++i ){ + PADNAME *padn; SV *val_sv; - name_sv = (AvARRAY(names)[i]); - val_sv = AvARRAY( values )[i]; - if ( SvPOKp(name_sv) && SvFAKE(name_sv) - && 0 == (SvFLAGS(name_sv) & SVpad_OUR ) - && SvCUR(name_sv) > 1 ){ + padn = (PadnamelistARRAY(names)[i]); + val_sv = PadARRAY( values )[i]; + if ( PadnamePV(padn) && PadnameOUTER(padn) + && !PadnameIsOUR(padn) + && PadnameLEN(padn) > 1 ){ I32 position; + SV * const name_sv = PadnameSV(padn); XPUSHs(name_sv); mXPUSHi( i ); position = find_sv( subcv, subcv_depth, context_seq, val_sv);
RT-Send-CC: grian [...] cpan.org
Sorry, that would not have worked under 5.8. Please try this patch.
Subject: new patch.text
diff -rup Eval-Compile-0.10-j8v_qy/Compile.xs Eval-Compile-0.10-raBUMW/Compile.xs --- Eval-Compile-0.10-j8v_qy/Compile.xs 2010-12-13 06:33:15.000000000 -0800 +++ Eval-Compile-0.10-raBUMW/Compile.xs 2012-08-22 22:16:05.000000000 -0700 @@ -22,6 +22,27 @@ # define COP_SEQ_RANGE_HIGH(sv) U_32(SvUVX(sv)) #endif +#ifndef PadARRAY +typedef AV PADNAMELIST; +typedef SV PADNAME; +# if PERL_VERSION < 8 || (PERL_VERSION == 8 && !PERL_SUBVERSION) +typedef AV PADLIST; +typedef AV PAD; +# endif +# define PadlistARRAY AvARRAY +# define PadlistNAMES(pl) (*PadlistARRAY(pl)) +# define PadnamelistARRAY(pnl) ((PADNAME **)AvARRAY(pnl)) +# define PadnamelistMAX(pnl) AvFILLp(pnl) +# define PadARRAY AvARRAY +# define PadMAX AvFILLp +# define PadnamePV(pn) (SvPOKp(pn) ? SvPVX(pn) : NULL) +# define PadnameLEN(pn) SvCUR(pn) +# define PadnameIsOUR(pn) !!(SvFLAGS(pn) & SVpad_OUR) +# define PadnameOUTER(pn) !!SvFAKE(pn) +# define PadnameSV(pn) pn +#endif + + /* For development testing */ #ifdef PADWALKER_DEBUGGING @@ -65,10 +86,10 @@ my_av_pushpvn( pTHX_ AV *av, char *p, ST void _show_cvpad( CV *cv ){ if ( cv && CvPADLIST( cv ) ){ - AV *padlist = CvPADLIST( cv ); - AV * padnames = (AV *)(AvARRAY(padlist)[0]); + PADLIST *padlist = CvPADLIST( cv ); + PADNAMELIST * padnames = PadlistNAMES(padlist); I32 i; - I32 namefill = AvFILLp( padnames ); + I32 namefill = PadnamelistMAX( padnames ); CV *cvout; if ( PL_DBsub && cv == GvCV(PL_DBsub) ){ fprintf( stderr, " DB::sub"); @@ -83,12 +104,13 @@ void _show_cvpad( CV *cv ){ cvout = CvOUTSIDE( cvout ); } while( cvout ); for(i=0; i<=namefill; ++i){ - SV *name_sv; + PADNAME *name_sv; STRLEN name_len; - name_sv = AvARRAY( padnames )[i]; - if (name_sv && SvPOKp(name_sv) && ( name_len = SvCUR(name_sv)) > 1) { - char* name_str = SvPVX(name_sv); - bool is_my = ((SvFLAGS(name_sv) & SVpad_OUR) == 0); + name_sv = PadnamelistARRAY( padnames )[i]; + if (name_sv && PadnamePV(name_sv) + && ( name_len = PadnameLEN(name_sv)) > 1) { + char* name_str = PadnamePV(name_sv); + bool is_my = !PadnameIsOUR(name_sv); if ( is_my ) { fprintf( stderr, " %s(%d,%d)", name_str, COP_SEQ_RANGE_LOW(name_sv), COP_SEQ_RANGE_HIGH(name_sv) ); } @@ -99,10 +121,10 @@ void _show_cvpad( CV *cv ){ typedef struct my_closure{ CV *closure_cv; - AV **closure_pad; + PAD **closure_pad; long stack_depth; CV *outer; - AV **outer_pad; + PAD **outer_pad; I32 outer_depth; I32 offset_size; I32 *position; @@ -119,17 +141,17 @@ cl_prepare_closure( pTHX_ p_closure cl, I32 find_sv( CV * cv, I32 cv_depth, U32 cop_seq, SV *val ){ I32 i; - AV *pad; - AV *padval; - AV *padname; + PADLIST *pad; + PAD *padval; + PADNAMELIST *padname; pad= CvPADLIST( cv ); if (!pad) return -1; - padval = (AV *)AvARRAY( pad )[cv_depth]; - padname = (AV *)AvARRAY( pad )[0]; - for ( i=0; i<=AvFILLp( padval ); ++i){ - if ( AvARRAY( padval )[i] == val ){ - if ( SvFAKE(AvELT( padname, i))){ + padval = PadlistARRAY( pad )[cv_depth]; + padname = PadlistNAMES(pad); + for ( i=0; i<=PadMAX( padval ); ++i){ + if ( PadARRAY( padval )[i] == val ){ + if ( PadnameOUTER(AvELT( padname, i))){ // fprintf( stderr, "==!!!===%d\n", i); return -2; } @@ -148,15 +170,15 @@ void cl_init( pTHX_ p_closure cl, AV*tem U32 context_seq; CV *curcv; I32 curcv_depth; - AV *names; - AV *values; + PADNAMELIST *names; + PAD *values; long stack_depth; int i; bool context_match; if ( ! cl->ok ) return; if (cv && CvPADLIST( cv ) ){ - AV *padlist = CvPADLIST( cv ); + PADLIST *padlist = CvPADLIST( cv ); if (CvDEPTH(cv)){ croak( "Fail compile: cv is running" ); } @@ -202,16 +224,16 @@ void cl_init( pTHX_ p_closure cl, AV*tem if ( ! CvPADLIST( curcv )) return; - names = (AV *)(AvARRAY(padlist)[0]); - values =(AV *)(AvARRAY(padlist)[1]); - for (i=0; i<= AvFILLp( names ) ; ++i ){ - SV *name_sv; + names = PadlistNAMES(padlist); + values =PadlistARRAY(padlist)[1]; + for (i=0; i<= PadnamelistMAX( names ) ; ++i ){ + PADNAME *name_sv; SV *val_sv; - name_sv = (AvARRAY(names)[i]); - val_sv = AvARRAY( values )[i]; - if ( SvPOKp(name_sv) && SvFAKE(name_sv) - && 0 == (SvFLAGS(name_sv) & SVpad_OUR ) - && SvCUR(name_sv) > 1 ){ + name_sv = (PadnamelistARRAY(names)[i]); + val_sv = PadARRAY( values )[i]; + if ( PadnamePV(name_sv) && PadnameOUTER(name_sv) + && !PadnameIsOUR(name_sv) + && PadnameLEN(name_sv) > 1 ){ ++(cl->offset_size); } } @@ -228,13 +250,13 @@ void cl_init( pTHX_ p_closure cl, AV*tem cl->offset_size = 0; for (i=0; i<= AvFILLp( names ) ; ++i ){ - SV *name_sv; + PADNAME *name_sv; SV *val_sv; name_sv = (AvARRAY(names)[i]); val_sv = AvARRAY( values )[i]; - if ( SvPOKp(name_sv) && SvFAKE(name_sv) - && 0 == (SvFLAGS(name_sv) & SVpad_OUR ) - && SvCUR(name_sv) > 1 ){ + if ( PadnamePV(name_sv) && PadnameOUTER(name_sv) + && !PadnameIsOUR(name_sv) + && PadnameLEN(name_sv) > 1 ){ I32 position; position = find_sv( curcv, curcv_depth, context_seq, val_sv); //fprintf( stderr, "%d=\n", position ); @@ -246,8 +268,8 @@ void cl_init( pTHX_ p_closure cl, AV*tem cl->position[ cl->offset_size++] = i; } } - cl->outer_pad =( AV **) AvARRAY( CvPADLIST( curcv )); - cl->closure_pad = ( AV **)AvARRAY( CvPADLIST( cl->closure_cv )); + cl->outer_pad = PadlistARRAY( CvPADLIST( curcv )); + cl->closure_pad = PadlistARRAY( CvPADLIST( cl->closure_cv )); cl_prepare_closure( aTHX_ cl, 0 ); //fprintf( stderr, "\n"); } @@ -258,8 +280,8 @@ cl_prepare_closure( pTHX_ p_closure cl, I32 i; I32 j; I32 cv_depth = cl->outer_depth; - SV **out_values = AvARRAY(cl->outer_pad[cv_depth]); - SV **closure_values = AvARRAY(cl->closure_pad[1]); + SV **out_values = PadARRAY(cl->outer_pad[cv_depth]); + SV **closure_values = PadARRAY(cl->closure_pad[1]); if ( !cl->ok ) return; @@ -545,8 +567,8 @@ void callers( CV * cv, SV *eval_string ) PREINIT: int i; - AV *names; - AV *values; + PADNAMELIST *names; + PAD *values; CV *subcv; long subcv_depth; long stack_depth; @@ -555,7 +577,7 @@ callers( CV * cv, SV *eval_string ) AV *results; PPCODE: if (cv && CvPADLIST( cv ) ){ - AV *padlist = CvPADLIST( cv ); + PADLIST *padlist = CvPADLIST( cv ); if (CvDEPTH(cv)){ croak( "Fail compile: cv is running" ); } @@ -596,18 +618,19 @@ callers( CV * cv, SV *eval_string ) _show_cvpad( cxstack[ stack_depth ].blk_sub.cv ); - names = (AV *)(AvARRAY(padlist)[0]); - values =(AV *)(AvARRAY(padlist)[1]); + names = PadlistNAMES(padlist); + values =PadlistARRAY(padlist)[1]; - for (i=0; i<= AvFILLp( names ) ; ++i ){ - SV *name_sv; + for (i=0; i<= PadnamelistMAX( names ) ; ++i ){ + PADNAME *padn; SV *val_sv; - name_sv = (AvARRAY(names)[i]); - val_sv = AvARRAY( values )[i]; - if ( SvPOKp(name_sv) && SvFAKE(name_sv) - && 0 == (SvFLAGS(name_sv) & SVpad_OUR ) - && SvCUR(name_sv) > 1 ){ + padn = (PadnamelistARRAY(names)[i]); + val_sv = PadARRAY( values )[i]; + if ( PadnamePV(padn) && PadnameOUTER(padn) + && !PadnameIsOUR(padn) + && PadnameLEN(padn) > 1 ){ I32 position; + SV * const name_sv = PadnameSV(padn); XPUSHs(name_sv); mXPUSHi( i ); position = find_sv( subcv, subcv_depth, context_seq, val_sv);
Subject: Re: [rt.cpan.org #79153] [PATCH] Pad changes in 5.17.4-to-be
Date: Wed, 29 Aug 2012 17:02:00 +0400
To: bug-Eval-Compile [...] rt.cpan.org
From: Гришаев Анатолий <0body1 [...] rambler.ru>
Hi, thanks for your patch. I am a little busy now. I will have possibility to apply the patch after a week. 24.08.2012 9:33, Father Chrysostomos via RT пишет: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=79153 > > > Sorry, that would not have worked under 5.8. Please try this patch.
-- С уважением Анатолий
Subject: Re: [rt.cpan.org #79153] [PATCH] Pad changes in 5.17.4-to-be
Date: Mon, 17 Sep 2012 15:58:26 +0400
To: bug-Eval-Compile [...] rt.cpan.org
From: Гришаев Анатолий <0body1 [...] rambler.ru>
24.08.2012 9:33, Father Chrysostomos via RT пишет: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=79153 > > > Sorry, that would not have worked under 5.8. Please try this patch.
Upplied -- С уважением Анатолий