Skip Menu |

This queue is for tickets about the Devel-Declare CPAN distribution.

Report information
The Basics
Id: 45779
Status: resolved
Priority: 0/
Queue: Devel-Declare

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

Bug Information
Severity: Critical
Broken in: 0.005001
Fixed in: 0.005005



Subject: fix MAD failure
cygwin perl has MAD enabled. It needs the attached patch. -- Reini Urban
Subject: Devel-Declare-MAD.patch
difforig Devel-Declare-0.005001 diff -u Devel-Declare-0.005001/stolen_chunk_of_toke.c.orig --- Devel-Declare-0.005001/stolen_chunk_of_toke.c.orig 2009-01-29 23:36:33.000000000 +0100 +++ Devel-Declare-0.005001/stolen_chunk_of_toke.c 2009-05-06 14:45:39.515625000 +0200 @@ -35,7 +35,7 @@ #define DPTR2FPTR(t,p) ((t)PTR2nat(p)) /* data pointer to function pointer */ #define FPTR2DPTR(t,p) ((t)PTR2nat(p)) /* function pointer to data pointer */ #define PTR2nat(p) (PTRV)(p) /* pointer to integer of PTRSIZE */ -#define MEM_WRAP_CHECK_(n,t) MEM_WRAP_CHECK(n,t), +/*#define MEM_WRAP_CHECK_(n,t) MEM_WRAP_CHECK(n,t),*/ /* conditionalise these two because as of 5.9.5 we already get them from the headers (mst) */ @@ -136,12 +136,17 @@ #define PL_tokenbuf (PL_parser->tokenbuf) #define PL_multi_end (PL_parser->multi_end) #define PL_error_count (PL_parser->error_count) -/* these three are from the non-PERL_MAD path but I don't -think- I need +#define PL_nexttoke (PL_parser->nexttoke) +/* these are from the non-PERL_MAD path but I don't -think- I need the PERL_MAD stuff since my code isn't really populating things (mst) */ -# define PL_nexttoke (PL_parser->nexttoke) +# ifdef PERL_MAD +# define PL_curforce (PL_parser->curforce) +# define PL_lasttoke (PL_parser->lasttoke) +# else # define PL_nexttype (PL_parser->nexttype) # define PL_nextval (PL_parser->nextval) -/* end of backcompat macros form 5.9 toke.c (mst) */ +# endif +/* end of backcompat macros from 5.9 toke.c (mst) */ #endif /* when ccflags include -DDEBUGGING we need this for earlier 5.8 perls */ @@ -843,13 +848,25 @@ STATIC void S_force_next(pTHX_ I32 type) { + dVAR; +#ifdef PERL_MAD + if (PL_curforce < 0) + start_force(PL_lasttoke); + PL_nexttoke[PL_curforce].next_type = type; + if (PL_lex_state != LEX_KNOWNEXT) + PL_lex_defer = PL_lex_state; + PL_lex_state = LEX_KNOWNEXT; + PL_lex_expect = PL_expect; + PL_curforce = -1; +#else PL_nexttype[PL_nexttoke] = type; PL_nexttoke++; if (PL_lex_state != LEX_KNOWNEXT) { - PL_lex_defer = PL_lex_state; - PL_lex_expect = PL_expect; - PL_lex_state = LEX_KNOWNEXT; + PL_lex_defer = PL_lex_state; + PL_lex_expect = PL_expect; + PL_lex_state = LEX_KNOWNEXT; } +#endif } #define XFAKEBRACK 128
On Wed May 06 08:50:09 2009, RURBAN wrote: Show quoted text
> cygwin perl has MAD enabled. > It needs the attached patch.
Thanks for the patch. I'd love to see perls with MAD enabled supported. I got a few questions about your patch tho. In S_force_next you add a dVAR for both mad and non-mad perls. Is that intentional? It appears to break compilation on non-mad 5.8 perls. You comment out the definition of MEM_WRAP_CHECK_. Why is that necessary?