perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@ectoplasm.org>
Subject Re: [PATCH] Check AV* is not NULL before calling av_undef()
Date Wed, 11 Jul 2007 18:29:14 GMT
Steve Hay wrote:
> Philippe M. Chiasson wrote:
>> Steve Hay wrote:
>>> The attached patch stops mod_perl-1.x from calling av_undef() on a NULL AV*.
>> Applied, built and tested just fine on my side.
>>
>> Only minor comment would be to consider writing a macro around this to
>> avoid duplicating the code.
>>
>> #define MP_safe_av_undef(av)
>>
>> Or something like that.
> 
> OK, how about the attached patch instead?

Much better/clearer IMO

>> For bonus points, only enable the workaround for affected versions of perl
>> and fallback to the original av_undef() otherwise.
> 
> That's not so easy because it isn't easy to tell what versions of perl 
> are affected. We could check for perls >= 5.9.5, but that would wrongly 
> include most versions of bleadperl kicking around between the release of 
> 5.9.4 and the application of change #26513 (not a big problem), and 
> would also wrongly not include any future 5.8.x releases that change 
> #26513 might get integrated into. It doesn't seem to me like being worth 
> the trouble.

Agreed.

> The change works fine with older perls, in which av_undef(NULL) is 
> basically just a no-op anyway.

Tested and works just fine. Of course, I wasn't able to reproduce the
problem itself, and a test case that specifically causes this problem
could be nice.

+1

------------------------------------------------------------------------
Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/


Mime
View raw message