Change 34879 by [EMAIL PROTECTED] on 2008/11/18 11:09:47

        Rafael noticed a bug in 34873 - I was comparing against the wrong
        variable, and hence (usually) saving all globs, not just those that
        should be kept.

Affected files ...

... //depot/perl/pp_ctl.c#714 edit
... //depot/perl/t/comp/retainedlines.t#3 edit

Differences ...

==== //depot/perl/pp_ctl.c#714 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#713~34876~    2008-11-17 14:54:17.000000000 -0800
+++ perl/pp_ctl.c       2008-11-18 03:09:47.000000000 -0800
@@ -3731,7 +3731,7 @@
     PUTBACK;
     ok = doeval(gimme, NULL, runcv, seq);
     if ((PERLDB_LINE || PERLDB_SAVESRC)
-       && was != (I32)PL_sub_generation /* Some subs defined here. */
+       && was != (U32)PL_breakable_sub_generation /* Some subs defined here. */
        && ok) {
        /* Just need to change the string in our writable scratch buffer that
           will be used at scope exit to delete this eval's "file" name, to

==== //depot/perl/t/comp/retainedlines.t#3 (text) ====
Index: perl/t/comp/retainedlines.t
--- perl/t/comp/retainedlines.t#2~34876~        2008-11-17 14:54:17.000000000 
-0800
+++ perl/t/comp/retainedlines.t 2008-11-18 03:09:47.000000000 -0800
@@ -10,7 +10,9 @@
 
 use strict;
 
-plan( tests => 19 );
+plan (tests => 21);
+
+$^P = 0xA;
 
 my @before = grep { /eval/ } keys %::;
 
@@ -20,7 +22,6 @@
 my $name = 'foo';
 
 for my $sep (' ', "\0") {
-    $^P = 0xA;
 
     my $prog = "sub $name {
     'Perl${sep}Rules'
@@ -46,3 +47,11 @@
     $seen{$keys[0]}++;
     $name++;
 }
+
+is (eval '1 + 1', 2, 'String eval works');
+
+my @after = grep { /eval/ } keys %::;
+
+is (@after, 0 + keys %seen,
+    "evals that don't define subroutines are correctly cleaned up");
+
End of Patch.

Reply via email to