Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl-cvs

svn commit: r555908 - in /perl/modperl/branches/1.x/src/modules/perl: mod_perl.c mod_perl.h

 

 

ModPerl modperl-cvs RSS feed   Index | Next | Previous | View Threaded


stevehay at apache

Jul 13, 2007, 1:21 AM

Post #1 of 1 (1077 views)
Permalink
svn commit: r555908 - in /perl/modperl/branches/1.x/src/modules/perl: mod_perl.c mod_perl.h

Author: stevehay
Date: Fri Jul 13 01:21:11 2007
New Revision: 555908

URL: http://svn.apache.org/viewvc?view=rev&rev=555908
Log:
Don't call av_undef() on a NULL AV*.

This fixes some horrible nastiness when using perl-5.9.5, which no longer
returns early from av_undef() in the case that the AV* is NULL, as of perl
change #26513.


Modified:
perl/modperl/branches/1.x/src/modules/perl/mod_perl.c
perl/modperl/branches/1.x/src/modules/perl/mod_perl.h

Modified: perl/modperl/branches/1.x/src/modules/perl/mod_perl.c
URL: http://svn.apache.org/viewvc/perl/modperl/branches/1.x/src/modules/perl/mod_perl.c?view=diff&rev=555908&r1=555907&r2=555908
==============================================================================
--- perl/modperl/branches/1.x/src/modules/perl/mod_perl.c (original)
+++ perl/modperl/branches/1.x/src/modules/perl/mod_perl.c Fri Jul 13 01:21:11 2007
@@ -277,13 +277,8 @@

mp_request_rec = 0;

- av_undef(orig_inc);
- SvREFCNT_dec((SV*)orig_inc);
- orig_inc = Nullav;
-
- av_undef(cleanup_av);
- SvREFCNT_dec((SV*)cleanup_av);
- cleanup_av = Nullav;
+ MP_safe_av_undef(orig_inc)
+ MP_safe_av_undef(cleanup_av)

#ifdef PERL_STACKED_HANDLERS
hv_undef(stacked_handlers);
@@ -1159,9 +1154,7 @@
perl_clear_env();

/* reset @INC */
- av_undef(GvAV(incgv));
- SvREFCNT_dec(GvAV(incgv));
- GvAV(incgv) = Nullav;
+ MP_safe_av_undef(GvAV(incgv))
GvAV(incgv) = av_copy_array(orig_inc);

/* reset $/ */

Modified: perl/modperl/branches/1.x/src/modules/perl/mod_perl.h
URL: http://svn.apache.org/viewvc/perl/modperl/branches/1.x/src/modules/perl/mod_perl.h?view=diff&rev=555908&r1=555907&r2=555908
==============================================================================
--- perl/modperl/branches/1.x/src/modules/perl/mod_perl.h (original)
+++ perl/modperl/branches/1.x/src/modules/perl/mod_perl.h Fri Jul 13 01:21:11 2007
@@ -301,6 +301,13 @@

#define av_copy_array(av) av_make(av_len(av)+1, AvARRAY(av))

+#define MP_safe_av_undef(av) \
+if (av != Nullav) { \
+ av_undef(av); \
+ SvREFCNT_dec((SV*)av); \
+ av = Nullav; \
+}
+
#ifndef newRV_noinc
#define newRV_noinc(sv) ((Sv = newRV(sv)), --SvREFCNT(SvRV(Sv)), Sv)
#endif

ModPerl modperl-cvs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.