summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-05-04 13:22:13 +0100
committerDavid Mitchell <davem@iabyn.com>2010-05-04 14:45:54 +0100
commit5afa72af5aa99c40932771ad390abf5ba229611b (patch)
tree51755a9bb47818b503103d7fdfad3ee9c23cac8a /mg.c
parentc919e87379678094951ae4130a71bdc1938ccde1 (diff)
downloadperl-5afa72af5aa99c40932771ad390abf5ba229611b.tar.gz
make local @tied, %tied, untied
Fix for RT #7938, #7939: when localising an array or hash, don't make the new aggregate tied. The old behaviour of { local @tied; ... } was equivalent to: { my $saved = \@tied; *tied = []; tied(@tied) = tied(@$saved) # if tied() were an lvalue function ... *tied = $saved; } This patch simply removes the 'tied(@tied) = ...' step
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mg.c b/mg.c
index 4be1b3c2e1..ccb5b82117 100644
--- a/mg.c
+++ b/mg.c
@@ -178,6 +178,7 @@ S_is_container_magic(const MAGIC *mg)
case PERL_MAGIC_arylen_p:
case PERL_MAGIC_rhash:
case PERL_MAGIC_symtab:
+ case PERL_MAGIC_tied: /* treat as value, so 'local @tied' isn't tied */
return 0;
default:
return 1;