Skip Menu |

This queue is for tickets about the B-Generate CPAN distribution.

Report information
The Basics
Id: 29257
Status: resolved
Priority: 0/
Queue: B-Generate

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

Bug Information
Severity: Critical
Broken in: 1.10
Fixed in: 1.11



Subject: halfway 5.9/5.10 patch
Attached is my halfway patch through 5.9 and 5.10 support. It just fixes the xs compiler errors, the logic still has to be fixed. * Fixed the xs compiler errors for 5.9, tests fail * Modification of B::OP::seq will lead to "Cannot modify B::OP::seq! Use B::OP::opt, B::OP::latefree, B::OP::latefreed or B::OP::attached" * new bool functions B::OP::opt, B::OP::latefree, B::OP::latefreed, B::OP::attached * B::PMOP::pmnext unsupported since 5.9 * B::PMOP::pmpermflags unsupported since 5.9 * B::COP::arybase unsupported since 5.9 -- Reini Urban
Subject: B-Generate-1.10.patch
2007-09-09 Reini Urban <rurban@x-ray.at> * Fixed the xs compiler errors for 5.9, test fails * Modification of B::OP::seq will lead to "Cannot modify B::OP::seq! Use B::OP::opt, B::OP::latefree, B::OP::latefreed or B::OP::attached" * new bool functions B::OP::opt, B::OP::latefree, B::OP::latefreed, B::OP::attached * B::PMOP::pmnext unsupported since 5.9 * B::PMOP::pmpermflags unsupported since 5.9 * B::COP::arybase unsupported since 5.9 diff -ub B-Generate-1.10/lib/B/Generate.xs.orig --- B-Generate-1.10/lib/B/Generate.xs.orig 2007-07-10 14:28:47.000000000 +0000 +++ B-Generate-1.10/lib/B/Generate.xs 2007-09-09 13:13:12.218750000 +0000 @@ -10,7 +10,17 @@ #undef PL_op_desc #define PL_op_name (get_op_names()) #define PL_opargs (get_opargs()) -#define PL_op_desc (get_op_descs()) +#define PL_op_desc ((char *)get_op_descs()) +#endif + +#ifndef PERL_VERSION +# include <patchlevel.h> +# if !(defined(PERL_VERSION) || (SUBVERSION > 0 && defined(PATCHLEVEL))) +# include <could_not_find_Perl_patchlevel.h> +# endif +# define PERL_REVISION 5 +# define PERL_VERSION PATCHLEVEL +# define PERL_SUBVERSION SUBVERSION #endif static char *svclassnames[] = { @@ -246,16 +256,16 @@ HE *ent; SV *value; if (!PL_custom_op_names) - return 0; + return NULL; /* This is sort of a hv_fetch, backwards */ (void)hv_iterinit(PL_custom_op_names); while ((ent = hv_iternext(PL_custom_op_names))) { if (strEQ(SvPV_nolen(hv_iterval(PL_custom_op_names,ent)),name)) - return (void*)SvIV(hv_iterkeysv(ent)); + return INT2PTR(void*,SvIV(hv_iterkeysv(ent))); } - return 0; + return NULL; } #endif @@ -458,7 +468,7 @@ OUTPUT: RETVAL -#define OP_desc(o) PL_op_desc[o->op_type] +#define OP_desc(o) (char* const)PL_op_desc[o->op_type] MODULE = B::Generate PACKAGE = B::OP PREFIX = OP_ @@ -495,7 +505,7 @@ B::OP o CODE: if (items > 1) - o->op_ppaddr = (void*)SvIV(ST(1)); + o->op_ppaddr = INT2PTR(void*,SvIV(ST(1))); RETVAL = PTR2IV((void*)(o->op_ppaddr)); OUTPUT: RETVAL @@ -574,12 +584,62 @@ OP_seq(o, ...) B::OP o CODE: +#if (PERL_VERSION > 8) + if (items > 1) + croak("Cannot modify op_seq! Split into bits: op_opt,op_latefree,op_latefreed,op_attached"); + RETVAL = o->op_opt || (o->op_latefree >> 1) || (o->op_latefreed >> 2) || (o->op_attached >> 3); +#else if (items > 1) o->op_seq = (U16)SvIV(ST(1)); RETVAL = o->op_seq; +#endif + OUTPUT: + RETVAL + +#if (PERL_VERSION > 8) + +bool +OP_opt(o, ...) + B::OP o + CODE: + if (items > 1) + o->op_opt = (bool)SvIV(ST(1)); + RETVAL = o->op_opt; + OUTPUT: + RETVAL + +bool +OP_latefree(o, ...) + B::OP o + CODE: + if (items > 1) + o->op_latefree = (bool)SvIV(ST(1)); + RETVAL = o->op_latefree; + OUTPUT: + RETVAL + +bool +OP_latefreed(o, ...) + B::OP o + CODE: + if (items > 1) + o->op_latefreed = (bool)SvIV(ST(1)); + RETVAL = o->op_latefreed; + OUTPUT: + RETVAL + +bool +OP_attached(o, ...) + B::OP o + CODE: + if (items > 1) + o->op_attached = (bool)SvIV(ST(1)); + RETVAL = o->op_attached; OUTPUT: RETVAL +#endif + U8 OP_flags(o, ...) B::OP o @@ -1024,7 +1084,11 @@ OP * root = NO_INIT CODE: ST(0) = sv_newmortal(); +#if (PERL_VERSION > 8) + root = o->op_pmreplrootu.op_pmreplroot; +#else root = o->op_pmreplroot; +#endif /* OP_PUSHRE stores an SV* instead of an OP* in op_pmreplroot */ if (o->op_type == OP_PUSHRE) { sv_setiv(newSVrv(ST(0), root ? @@ -1039,9 +1103,15 @@ PMOP_pmreplstart(o, ...) B::PMOP o CODE: +#if (PERL_VERSION > 8) + if (items > 1) + o->op_pmstashstartu.op_pmreplstart = SVtoO(ST(1)); + RETVAL = o->op_pmstashstartu.op_pmreplstart; +#else if (items > 1) o->op_pmreplstart = SVtoO(ST(1)); RETVAL = o->op_pmreplstart; +#endif OUTPUT: RETVAL @@ -1049,19 +1119,31 @@ PMOP_pmnext(o, ...) B::PMOP o CODE: +#if (PERL_VERSION > 8) + croak("B::PMOP::pmnext unsupported since 5.9"); +#else if (items > 1) o->op_pmnext = (PMOP*)SVtoO(ST(1)); RETVAL = o->op_pmnext; +#endif OUTPUT: RETVAL -U16 +U32 PMOP_pmflags(o) B::PMOP o -U16 +U32 PMOP_pmpermflags(o) B::PMOP o + CODE: +#if (PERL_VERSION > 8) + croak("B::PMOP::pmpermflags unsupported since 5.9"); +#else + RETVAL = o->op_pmpermflags; +#endif + OUTPUT: + RETVAL void PMOP_precomp(o) @@ -1219,7 +1301,11 @@ #define COP_cop_seq(o) o->cop_seq #define COP_arybase(o) o->cop_arybase #define COP_line(o) CopLINE(o) -#define COP_warnings(o) o->cop_warnings +#if (PERL_VERSION > 8) +# define COP_warnings(o) (SV*)(STRLEN *)o->cop_warnings +#else +# define COP_warnings(o) o->cop_warnings +#endif MODULE = B::Generate PACKAGE = B::COP PREFIX = COP_ @@ -1247,6 +1333,10 @@ I32 COP_arybase(o) B::COP o + CODE: +#if (PERL_VERSION > 8) + croak("B::COP::arybase unsupported since 5.9"); +#endif U16 COP_line(o) @@ -1373,6 +1463,6 @@ specialsv_list[1] = &PL_sv_undef; specialsv_list[2] = &PL_sv_yes; specialsv_list[3] = &PL_sv_no; - specialsv_list[4] = pWARN_ALL; - specialsv_list[5] = pWARN_NONE; - specialsv_list[6] = pWARN_STD; + specialsv_list[4] = (SV*)pWARN_ALL; + specialsv_list[5] = (SV*)pWARN_NONE; + specialsv_list[6] = (SV*)pWARN_STD;
Subject: 2nd half of 5.9/5.10 patch by Jim Cromie
RT-Send-CC: jim.cromie [...] gmail.com
apply jim's patch on top of mine, and everything will work fine. This patch, on top of yours, gets t/basic.t passing [jimc@harpo B-Generate-1.10-reine-mod]$ make test /usr/local/bin/perl5.10.0 Build --makefile_env_macros 1 test t/basic....ok All tests successful. Files=1, Tests=10, 0 wallclock secs ( 0.05 cusr + 0.01 csys = 0.06 CPU) [jimc@harpo B-Generate-1.10-reine-mod]$ works on 5.10, 5.9.5, 5.8.8 I dunno why the OP_LIST = 142 doesnt break 5.8.8, but there it is.. [jimc@harpo bleadperl]$ grep OP_LIST, ../maintperl/opnames.h OP_LIST, /* 141 */ [jimc@harpo bleadperl]$ grep OP_LIST, opnames.h OP_LIST, /* 142 */ -- Reini Urban
Download diff.bgen-1.10-reine-plus
application/octet-stream 2.7k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #29257] 2nd half of 5.9/5.10 patch by Jim Cromie
Date: Mon, 17 Sep 2007 16:26:22 -0700
To: bug-B-Generate [...] rt.cpan.org
From: "Joshua ben Jore" <twists [...] gmail.com>
On 9/15/07, Reini Urban via RT <bug-B-Generate@rt.cpan.org> wrote: Show quoted text
> > Queue: B-Generate > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=29257 > > > apply jim's patch on top of mine, > and everything will work fine. > > This patch, on top of yours, gets t/basic.t passing > > [jimc@harpo B-Generate-1.10-reine-mod]$ make test > /usr/local/bin/perl5.10.0 Build --makefile_env_macros 1 test > t/basic....ok > All tests successful. > Files=1, Tests=10, 0 wallclock secs ( 0.05 cusr + 0.01 csys = 0.06 CPU) > [jimc@harpo B-Generate-1.10-reine-mod]$ > > works on 5.10, 5.9.5, 5.8.8 > > I dunno why the OP_LIST = 142 doesnt break 5.8.8, but there it is.. > > [jimc@harpo bleadperl]$ grep OP_LIST, ../maintperl/opnames.h > OP_LIST, /* 141 */ > [jimc@harpo bleadperl]$ grep OP_LIST, opnames.h > OP_LIST, /* 142 */
I have a patch for B which exposes the constant OP_LIST and others. B::Generate could require that B be at least 1.18 and get this for free. Josh
Subject: Re: [rt.cpan.org #29257] 2nd half of 5.9/5.10 patch by Jim Cromie
Date: Mon, 17 Sep 2007 16:26:22 -0700
To: bug-B-Generate [...] rt.cpan.org
From: "Joshua ben Jore" <twists [...] gmail.com>
On 9/15/07, Reini Urban via RT <bug-B-Generate@rt.cpan.org> wrote: Show quoted text
> > Queue: B-Generate > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=29257 > > > apply jim's patch on top of mine, > and everything will work fine. > > This patch, on top of yours, gets t/basic.t passing > > [jimc@harpo B-Generate-1.10-reine-mod]$ make test > /usr/local/bin/perl5.10.0 Build --makefile_env_macros 1 test > t/basic....ok > All tests successful. > Files=1, Tests=10, 0 wallclock secs ( 0.05 cusr + 0.01 csys = 0.06 CPU) > [jimc@harpo B-Generate-1.10-reine-mod]$ > > works on 5.10, 5.9.5, 5.8.8 > > I dunno why the OP_LIST = 142 doesnt break 5.8.8, but there it is.. > > [jimc@harpo bleadperl]$ grep OP_LIST, ../maintperl/opnames.h > OP_LIST, /* 141 */ > [jimc@harpo bleadperl]$ grep OP_LIST, opnames.h > OP_LIST, /* 142 */
I have a patch for B which exposes the constant OP_LIST and others. B::Generate could require that B be at least 1.18 and get this for free. Josh
I believe that B-Generate-1.11, released by Josh Ben Jore, merged Reine's and my patches, along with a few tweaks. So, Im attempting to close it now. BTW, Ive uploaded B-Gen-12_03, but its not indexing. I think this is cuz Im not showing up in PAUSEs maintainer list for this module. Josh, could you add me to that list ? And naturally, please test on your platforms (Im x86 linux).
Fixed with 5.11. Thanks! -- Reini Urban
Subject: Re: [rt.cpan.org #29257] halfway 5.9/5.10 patch
Date: Sun, 17 Feb 2008 17:45:12 -0800
To: bug-B-Generate [...] rt.cpan.org, "Jim Cromie" <jim.cromie [...] gmail.com>
From: "Joshua ben Jore" <twists [...] gmail.com>
On Feb 1, 2008 9:55 AM, Jim Cromie via RT <bug-B-Generate@rt.cpan.org> wrote: Show quoted text
> > Queue: B-Generate > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=29257 > > > I believe that B-Generate-1.11, released by Josh Ben Jore, > merged Reine's and my patches, along with a few tweaks. > So, Im attempting to close it now. > > BTW, Ive uploaded B-Gen-12_03, but its not indexing. > I think this is cuz Im not showing up in PAUSEs maintainer > list for this module. Josh, could you add me to that list
you have maintainer access for the namespaces for B::Generate, B::OP, B::SVOP, B::SPECIAL. Those trailing ones are kind of random but it's what I had the ability to assign. Josh