This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert "[perl #77928] Glob slot assignment and set-magic"
authorFather Chrysostomos <sprout@cpan.org>
Wed, 29 Sep 2010 06:41:43 +0000 (23:41 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 29 Sep 2010 07:02:41 +0000 (00:02 -0700)
This reverts commit cffb36981555111f364a511fb5763f65ea748c0e.

pod/perldelta.pod
sv.h
t/op/gv.t

index 0eea356..4487718 100644 (file)
@@ -634,11 +634,6 @@ L<[perl #75154]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75154>.
 
 =item *
 
-Assignment through a glob no longer triggers set-magic on the glob itself
-L<[perl #77928]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77928>.
-
-=item *
-
 The regular expression parser no longer hangs when parsing C<\18> and
 C<\88>.
 
diff --git a/sv.h b/sv.h
index 2f03bfc..3be9559 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -1949,23 +1949,9 @@ Returns a pointer to the character buffer.
                SvSetSV_nosteal_and(dst,src,/*nothing*/;)
 
 #define SvSetMagicSV(dst,src) \
-    SvSetSV_and(dst,src,       \
-       if (SvSMAGICAL(dst)     \
-        && (                    \
-            !isGV_with_GP(dst) || !SvROK(src) || isGV_with_GP(SvRV(src)) \
-           )                                                             \
-          )                                                              \
-           mg_set(dst)                                                   \
-    )
+               SvSetSV_and(dst,src,SvSETMAGIC(dst))
 #define SvSetMagicSV_nosteal(dst,src) \
-    SvSetSV_nosteal_and(dst,src,       \
-       if (SvSMAGICAL(dst)             \
-        && (                            \
-            !isGV_with_GP(dst) || !SvROK(src) || isGV_with_GP(SvRV(src)) \
-           )                                                             \
-          )                                                              \
-           mg_set(dst)                                                   \
-    )
+               SvSetSV_nosteal_and(dst,src,SvSETMAGIC(dst))
 
 
 #if !defined(SKIP_DEBUGGING)
index b8363d2..32afdff 100644 (file)
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -12,7 +12,7 @@ BEGIN {
 
 use warnings;
 
-plan( tests => 220 );
+plan( tests => 219 );
 
 # type coersion on assignment
 $foo = 'foo';
@@ -783,19 +783,6 @@ EOF
  }}->($h{k});
 }
 
-# [perl #77928] Glob slot assignment and set-magic
-{
- package Readonly::Alias;
- sub TIESCALAR { bless \(my $x = \pop) }
- sub FETCH { $${$_[0]} }
- sub STORE { die "Assignment to read-only value" }
- package main;
- tie my $alias, "Readonly::Alias", my $var;
- $var = *bength;
- # Now modify a glob slot, not the alias itself:
- ok(scalar eval { *$alias = [] }, 'glob slot assignment skips set-magic');
-}
-
 __END__
 Perl
 Rules