This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In Perl_op_clear(), uncomment the call to mad_free()
authorNicholas Clark <nick@ccl4.org>
Mon, 11 Apr 2011 19:31:29 +0000 (20:31 +0100)
committerNicholas Clark <nick@ccl4.org>
Thu, 19 May 2011 07:55:56 +0000 (08:55 +0100)
Free the MADPROPs when freeing their parent OP, now that all the other bugs are
fixed.

op.c

diff --git a/op.c b/op.c
index 4960d22..8523739 100644 (file)
--- a/op.c
+++ b/op.c
@@ -547,18 +547,8 @@ Perl_op_clear(pTHX_ OP *o)
     PERL_ARGS_ASSERT_OP_CLEAR;
 
 #ifdef PERL_MAD
-    /* if (o->op_madprop && o->op_madprop->mad_next)
-       abort(); */
-    /* FIXME for MAD - if I uncomment these two lines t/op/pack.t fails with
-       "modification of a read only value" for a reason I can't fathom why.
-       It's the "" stringification of $_, where $_ was set to '' in a foreach
-       loop, but it defies simplification into a small test case.
-       However, commenting them out has caused ext/List/Util/t/weak.t to fail
-       the last test.  */
-    /*
-      mad_free(o->op_madprop);
-      o->op_madprop = 0;
-    */
+    mad_free(o->op_madprop);
+    o->op_madprop = 0;
 #endif    
 
  retry: