Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Mouse CPAN distribution.

Report information
The Basics
Id: 88295
Status: open
Priority: 0/
Queue: Mouse

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 1.11
  • 1.12
Fixed in: (no value)



Subject: [PATCH] Fix for perl 5.19.4-to-be
Perl 5.19.4 and up use NULL to represent nonexistent array elements. This causes Mouse to crash. The attached patch is one possible way to fix this.
Subject: open_56GGGm4h.txt
diff -rup Mouse-1.11-2l40Hq/mouse.h Mouse-1.11-8jslEf/mouse.h --- Mouse-1.11-2l40Hq/mouse.h 2012-08-26 18:23:13.000000000 -0700 +++ Mouse-1.11-8jslEf/mouse.h 2013-08-30 12:59:26.000000000 -0700 @@ -90,10 +90,11 @@ MAGIC* mouse_mg_find(pTHX_ SV* const sv, /* MOUSE_av_at(av, ix) is the safer version of AvARRAY(av)[ix] if perl is compiled with -DDEBUGGING */ #ifdef DEBUGGING -#define MOUSE_av_at(av, ix) *mouse_av_at_safe(aTHX_ (av) , (ix)) -SV** mouse_av_at_safe(pTHX_ AV* const mi, I32 const ix); +#define MOUSE_av_at(av, ix) mouse_av_at_safe(aTHX_ (av) , (ix)) +SV* mouse_av_at_safe(pTHX_ AV* const mi, I32 const ix); #else -#define MOUSE_av_at(av, ix) AvARRAY(av)[ix] +#define MOUSE_av_at(av, ix) \ + (AvARRAY(av)[ix] ? AvARRAY(av)[ix] : &PL_sv_undef) #endif #define MOUSE_mg_obj(mg) ((mg)->mg_obj) diff -rup Mouse-1.11-2l40Hq/xs-src/MouseUtil.xs Mouse-1.11-8jslEf/xs-src/MouseUtil.xs --- Mouse-1.11-2l40Hq/xs-src/MouseUtil.xs 2013-04-24 21:49:45.000000000 -0700 +++ Mouse-1.11-8jslEf/xs-src/MouseUtil.xs 2013-08-30 12:59:37.000000000 -0700 @@ -76,12 +76,12 @@ mouse_mro_get_linear_isa(pTHX_ HV* const #endif /* !no_mor_get_linear_isa */ #ifdef DEBUGGING -SV** +SV* mouse_av_at_safe(pTHX_ AV* const av, I32 const ix){ assert(av); assert(SvTYPE(av) == SVt_PVAV); assert(AvMAX(av) >= ix); - return &AvARRAY(av)[ix]; + return AvARRAY(av)[ix] ? AvARRAY(av)[ix] : &PL_sv_undef; } #endif
Just FYI, I have verified that 1.12 does not work with 5.19.4 and that the patch still applies for 1.12 and makes all tests pass.