summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-04-18 22:25:30 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-04-18 22:43:13 -0700
commitd2d95e1390fa8da3e5c59558c1a326336e57c9dc (patch)
treee98716bf46c202b0e28bcc61ac4b6264200e269b
parent8cc10af2cb907db12330ae60222a46d9096065d4 (diff)
downloadperl-d2d95e1390fa8da3e5c59558c1a326336e57c9dc.tar.gz
Make push, etc., work on tied scalars
I broke this with commit d4fc441
-rw-r--r--pp.c1
-rw-r--r--t/op/tie_fetch_count.t3
2 files changed, 3 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 4c8827065a..d91faa4868 100644
--- a/pp.c
+++ b/pp.c
@@ -5400,6 +5400,7 @@ static AV *
S_deref_plain_array(pTHX_ AV *ary)
{
if (SvTYPE(ary) == SVt_PVAV) return ary;
+ SvGETMAGIC((SV *)ary);
if (!SvROK(ary) || SvTYPE(SvRV(ary)) != SVt_PVAV)
Perl_die(aTHX_ "Not an ARRAY reference");
else if (SvOBJECT(SvRV(ary)))
diff --git a/t/op/tie_fetch_count.t b/t/op/tie_fetch_count.t
index b0c1dd4c17..69d4619679 100644
--- a/t/op/tie_fetch_count.t
+++ b/t/op/tie_fetch_count.t
@@ -7,7 +7,7 @@ BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
- plan (tests => 208);
+ plan (tests => 209);
}
use strict;
@@ -162,6 +162,7 @@ tie my $var1 => 'main', \1;
$dummy = $$var1 ; check_count '${}';
tie my $var2 => 'main', [];
$dummy = @$var2 ; check_count '@{}';
+$dummy = shift $var2 ; check_count 'shift arrayref';
tie my $var3 => 'main', {};
$dummy = %$var3 ; check_count '%{}';
{