Skip Menu |

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

Report information
The Basics
Id: 33005
Status: resolved
Priority: 0/
Queue: Devel-Caller

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

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



Subject: [PATCH] 5.11 breaks sanity check
Bleadperl@33018 introduces CXp_HASARGS and so the sanity check in _context_cv breaks. I patched it as below and the tests pass again but I don't know if it is a good fix. Let me know if and how it can be done better. Thanks. Patch (without tweaked whitespace) also available from CPAN as ANDK/patches/Devel-Caller-2.03-ANDK-01.patch.gz. --- Devel-Caller-2.03-KD9mnt.orig/Caller.xs 2008-01-08 15:39:43.000000000 +0100 +++ Devel-Caller-2.03-KD9mnt/Caller.xs 2008-02-08 05:04:18.000000000 +0100 @@ -12,8 +12,13 @@ SV* context; PERL_CONTEXT *cx = INT2PTR(PERL_CONTEXT *, SvIV(context)); CV *cur_cv; - if (cx->cx_type != CXt_SUB) - croak("cx_type is %d not CXt_SUB\n", cx->cx_type); + if (cx->cx_type != CXt_SUB +#ifdef CXp_HASARGS + /* perforce #33018 */ + && cx->cx_type != (CXt_SUB|CXp_HASARGS) +#endif + ) + croak("cx_type is %d not %d\n", cx->cx_type, CXt_SUB); cur_cv = cx->blk_sub.cv; if (!cur_cv)
On Thu Feb 07 23:24:43 2008, ANDK wrote: Show quoted text
> Bleadperl@33018 introduces CXp_HASARGS and so the sanity check in > _context_cv breaks. I patched it as below and the tests pass again but I > don't know if it is a good fix. Let me know if and how it can be done > better. Thanks. > > Patch (without tweaked whitespace) also available from CPAN as > ANDK/patches/Devel-Caller-2.03-ANDK-01.patch.gz. > > --- Devel-Caller-2.03-KD9mnt.orig/Caller.xs 2008-01-08 > 15:39:43.000000000 +0100 > +++ Devel-Caller-2.03-KD9mnt/Caller.xs 2008-02-08 05:04:18.000000000 +0100 > @@ -12,8 +12,13 @@ SV* context; > PERL_CONTEXT *cx = INT2PTR(PERL_CONTEXT *, SvIV(context)); > CV *cur_cv; > > - if (cx->cx_type != CXt_SUB) > - croak("cx_type is %d not CXt_SUB\n", cx->cx_type); > + if (cx->cx_type != CXt_SUB > +#ifdef CXp_HASARGS > + /* perforce #33018 */ > + && cx->cx_type != (CXt_SUB|CXp_HASARGS) > +#endif > + ) > + croak("cx_type is %d not %d\n", cx->cx_type, CXt_SUB); > > cur_cv = cx->blk_sub.cv; > if (!cur_cv) >
Actually, a simpler patch is to use the CxTYPE() macro. --- Caller.xs.old 2008-01-12 11:49:51.000000000 -0600 +++ Caller.xs 2009-07-13 20:54:45.000000000 -0500 @@ -12,7 +12,7 @@ PERL_CONTEXT *cx = INT2PTR(PERL_CONTEXT *, SvIV(context)); CV *cur_cv; - if (cx->cx_type != CXt_SUB) + if (CxTYPE(cx) != CXt_SUB) croak("cx_type is %d not CXt_SUB\n", cx->cx_type); cur_cv = cx->blk_sub.cv;
Have rewritten in terms of CxTYPE and shipped 2.04. Thanks -- Richard Clamp <richardc@unixbeard.net>