perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r106473 - /perl/modperl/trunk/Changes /perl/modperl/trunk/src/modules/perl/modperl_cmd.c /perl/modperl/trunk/src/modules/perl/modperl_filter.c /perl/modperl/trunk/src/modules/perl/modperl_util.c /perl/modperl/trunk/todo/release
Date Wed, 24 Nov 2004 21:32:46 GMT
Author: stas
Date: Wed Nov 24 13:32:45 2004
New Revision: 106473

URL: http://svn.apache.org/viewcvs?view=rev&rev=106473
Log:
enclose all occurences of eval_* with ENTER;SAVETMPS;
... FREETMPS;LEAVE; previously things just happened to work, due to
external scopes which was not very reliable and some change could
introduce obsure bugs.

Modified:
   perl/modperl/trunk/Changes
   perl/modperl/trunk/src/modules/perl/modperl_cmd.c
   perl/modperl/trunk/src/modules/perl/modperl_filter.c
   perl/modperl/trunk/src/modules/perl/modperl_util.c
   perl/modperl/trunk/todo/release

Modified: perl/modperl/trunk/Changes
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?view=diff&rev=106473&p1=perl/modperl/trunk/Changes&r1=106472&p2=perl/modperl/trunk/Changes&r2=106473
==============================================================================
--- perl/modperl/trunk/Changes	(original)
+++ perl/modperl/trunk/Changes	Wed Nov 24 13:32:45 2004
@@ -12,6 +12,11 @@
 
 =item 1.99_18-dev
 
+enclose all occurences of eval_* with ENTER;SAVETMPS;
+... FREETMPS;LEAVE; previously things just happened to work, due to
+external scopes which was not very reliable and some change could
+introduce obsure bugs. [Stas]
+
 in case a native apache response filter is configured outside the
 <Location> block with PerlSet*Filter directive, make sure that
 mod_perl doesn't try to add it as connection filter (previously was

Modified: perl/modperl/trunk/src/modules/perl/modperl_cmd.c
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/modperl_cmd.c?view=diff&rev=106473&p1=perl/modperl/trunk/src/modules/perl/modperl_cmd.c&r1=106472&p2=perl/modperl/trunk/src/modules/perl/modperl_cmd.c&r2=106473
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_cmd.c	(original)
+++ perl/modperl/trunk/src/modules/perl/modperl_cmd.c	Wed Nov 24 13:32:45 2004
@@ -541,11 +541,11 @@
     
     {
         GV *gv = gv_fetchpv("0", TRUE, SVt_PV);
-        ENTER;
+        ENTER;SAVETMPS;
         save_scalar(gv); /* local $0 */
         sv_setpv_mg(GvSV(gv), directive->filename);
         eval_pv(arg, FALSE);
-        LEAVE;
+        FREETMPS;LEAVE;
     }
     
     if (SvTRUE(ERRSV)) {

Modified: perl/modperl/trunk/src/modules/perl/modperl_filter.c
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/modperl_filter.c?view=diff&rev=106473&p1=perl/modperl/trunk/src/modules/perl/modperl_filter.c&r1=106472&p2=perl/modperl/trunk/src/modules/perl/modperl_filter.c&r2=106473
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_filter.c	(original)
+++ perl/modperl/trunk/src/modules/perl/modperl_filter.c	Wed Nov 24 13:32:45 2004
@@ -393,11 +393,17 @@
         /* eval the code in the parent handler's package's context */
         char *code = apr_pstrcat(p, "package ", package_name, ";",
                                  init_handler_pv_code, NULL);
-        SV *sv = eval_pv(code, TRUE);
+        SV *sv;
+
+        ENTER;SAVETMPS;
+
+        sv = eval_pv(code, TRUE);
 
         /* fprintf(stderr, "code: %s\n", code); */
         modperl_handler_t *init_handler =
             modperl_handler_new_from_sv(aTHX_ p, sv);
+
+        FREETMPS;LEAVE;
 
         if (init_handler) {
             MP_TRACE_h(MP_FUNC, "found init handler %s\n",

Modified: perl/modperl/trunk/src/modules/perl/modperl_util.c
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/modperl_util.c?view=diff&rev=106473&p1=perl/modperl/trunk/src/modules/perl/modperl_util.c&r1=106472&p2=perl/modperl/trunk/src/modules/perl/modperl_util.c&r2=106473
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_util.c	(original)
+++ perl/modperl/trunk/src/modules/perl/modperl_util.c	Wed Nov 24 13:32:45 2004
@@ -21,6 +21,7 @@
 
     dSP;
     PUSHSTACKi(PERLSI_REQUIRE);
+    ENTER;SAVETMPS;
     PUTBACK;
     sv = sv_newmortal();
     sv_setpv(sv, "require ");
@@ -28,6 +29,7 @@
     eval_sv(sv, G_DISCARD);
     SPAGAIN;
     POPSTACK;
+    FREETMPS;LEAVE;
 
     if (SvTRUE(ERRSV)) {
         if (logfailure) {

Modified: perl/modperl/trunk/todo/release
Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/todo/release?view=diff&rev=106473&p1=perl/modperl/trunk/todo/release&r1=106472&p2=perl/modperl/trunk/todo/release&r2=106473
==============================================================================
--- perl/modperl/trunk/todo/release	(original)
+++ perl/modperl/trunk/todo/release	Wed Nov 24 13:32:45 2004
@@ -4,12 +4,6 @@
 
 -- see also todo/api_status
 
-* enclose all occurences of eval_* with ENTER;SAVETMPS;
-  ... FREETMPS;LEAVE; at the moment things just happen to work, due to
-  external scopes which is not very reliable and can change any moment
-  introducing obsure bugs.
-  owner: stas
-
 * APR::Finfo constants: APR::FILETYPE_* and APR::FILEPROT_* will
   probably be APR::FTYPE_* and APR::FPROT_*
   will know exactly once libapr is fixed

Mime
View raw message