Re: svn commit: r1717474 - in /perl/modperl/trunk: Changes src/modules/perl/mod_perl.c src/modules/perl/modperl_env.c src/modules/perl/modperl_env.h src/modules/perl/modperl_perl.c t/response/TestModperl/env.pm
Steve Hay <[email protected]> Wed, 4 Jan 2017 13:54:23 +0000
| Newsgroups | gmane.comp.apache.mod-perl.devel |
|---|---|
| Message-ID | <CADED=K4efR-0BKA__EEkGz5DEDDePGh4RngJ4NTFfQKuBJLAQQ@mail.gmail.com> |
On 4 January 2017 at 13:27, Rainer Jung <[email protected]> wrote: > Hi there, > > this commit broke compatibility for mod_perl 2.0.10 with perl before version > 5.14. AFAIK API function mg_free_type() used here was only introduced in > 5.14.0. Since the above commit was titled "Add support for Perl 5.22.x.", it > might be possible to fix this using a version dependent code path. But I > don't know enough about these internals to suggest an appropriate patch, > sorry. > Thanks for the report. Are you in a position to try the attached patch, which I think should be sufficient to fix it? (mg_free() removes magic of all types, but I wouldn't expect any magic other than the type targetted by the mg_free_type() call to be present anyway.) If not then I'll build a 5.14 and try it myself, but I don't have one to hand at the moment. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
mg_free.patch
(text/x-diff, 931 B)
Index: src/modules/perl/modperl_env.c
===================================================================
--- src/modules/perl/modperl_env.c (revision 1777309)
+++ src/modules/perl/modperl_env.c (working copy)
@@ -670,7 +670,11 @@
mg->mg_ptr, mg->mg_obj, mg->mg_flags);
/* Remove it */
+#if MP_PERL_VERSION_AT_LEAST(5, 13, 6)
mg_free_type((SV*)ENVHV, PERL_MAGIC_env);
+#else
+ mg_free((SV*)ENVHV);
+#endif
/* Add our version instead */
mg = sv_magicext((SV*)ENVHV, (SV*)NULL, PERL_MAGIC_env, &MP_vtbl_env, (char*)NULL, 0);
@@ -699,7 +703,11 @@
mg->mg_ptr, mg->mg_obj, mg->mg_flags);
/* Remove it */
+#if MP_PERL_VERSION_AT_LEAST(5, 13, 6)
mg_free_type((SV*)ENVHV, PERL_MAGIC_env);
+#else
+ mg_free((SV*)ENVHV);
+#endif
/* Restore perl's original version */
sv_magicext((SV*)ENVHV, (SV*)NULL, PERL_MAGIC_env, &PL_vtbl_env, (char*)NULL, 0);