Change 21039 by [EMAIL PROTECTED] on 2003/09/05 04:13:17

        Another seemingly fixed (un)tie bug,
        [perl ##22297] cannot untie scalar from within tied FETCH

Affected files ...

... //depot/perl/t/op/tie.t#35 edit

Differences ...

==== //depot/perl/t/op/tie.t#35 (xtext) ====
Index: perl/t/op/tie.t
--- perl/t/op/tie.t#34~21003~   Tue Sep  2 12:01:07 2003
+++ perl/t/op/tie.t     Thu Sep  4 21:13:17 2003
@@ -405,3 +405,44 @@
 4
 Three
 4
+########
+# [perl #22297] cannot untie scalar from within tied FETCH
+my $counter = 0;
+my $x = 7;
+my $ref = \$x;
+tie $x, 'Overlay', $ref, $x;
+my $y;
+$y = $x;
+$y = $x;
+$y = $x;
+$y = $x;
+#print "WILL EXTERNAL UNTIE $ref\n";
+untie $$ref;
+$y = $x;
+$y = $x;
+$y = $x;
+$y = $x;
+#print "counter = $counter\n";
+
+print (($counter == 1) ? "ok\n" : "not ok\n");
+
+package Overlay;
+
+sub TIESCALAR
+{
+        my $pkg = shift;
+        my ($ref, $val) = @_;
+        return bless [ $ref, $val ], $pkg;
+}
+
+sub FETCH
+{
+        my $self = shift;
+        my ($ref, $val) = @$self;
+        #print "WILL INTERNAL UNITE $ref\n";
+        $counter++;
+        untie $$ref;
+        return $val;
+}
+EXPECT
+ok
End of Patch.

Reply via email to