New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assignment ignores magick when the RHS holds a glob #10585
Comments
From @cpansprout#!perl -l Flags: Site configuration information for perl 5.13.4: Configured by sprout at Fri Aug 20 23:24:53 PDT 2010. Summary of my perl5 (revision 5 version 13 subversion 4 patch v5.13.4-16-g16c9153) configuration: Locally applied patches: @INC for perl 5.13.4: Environment for perl 5.13.4: |
From @cpansproutOn Aug 29, 2010, at 1:48 PM, Father Chrysostomos wrote:
This patch won’t apply without the one for bug #77362 applied first. If the patch for bug #77496 is not applied first, too, this one will cause test failures, as it triggers that bug. This modifies a test in t/op/tie_fetch_count.t, which currently relies on this bug. *{} is another one of those operators that can return its operand, like || and &&. |
From @cpansproutFrom: Father Chrysostomos <sprout@cpan.org> [perl #77498] Assignment ignores magick when the RHS holds a glob This also modifies a test in t/op/tie_fetch_count.t, which was rely- Inline Patchdiff -Nup blead-77362-glob2lv8/sv.c blead-77362-glob2lv9/sv.c
--- blead-77362-glob2lv8/sv.c 2010-08-26 04:31:32.000000000 -0700
+++ blead-77362-glob2lv9/sv.c 2010-08-26 04:54:45.000000000 -0700
@@ -3875,22 +3875,17 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, regi
/* case SVt_BIND: */
case SVt_PVLV:
case SVt_PVGV:
- if (isGV_with_GP(sstr) && dtype <= SVt_PVLV) {
- glob_assign_glob(dstr, sstr, dtype);
- return;
- }
/* SvVALID means that this PVGV is playing at being an FBM. */
- /*FALLTHROUGH*/
case SVt_PVMG:
if (SvGMAGICAL(sstr) && (flags & SV_GMAGIC)) {
mg_get(sstr);
if (SvTYPE(sstr) != stype)
stype = SvTYPE(sstr);
- if (isGV_with_GP(sstr) && dtype <= SVt_PVLV) {
+ }
+ if (isGV_with_GP(sstr) && dtype <= SVt_PVLV) {
glob_assign_glob(dstr, sstr, dtype);
return;
- }
}
if (stype == SVt_PVLV)
SvUPGRADE(dstr, SVt_PVNV);
diff -Nurp blead-77362-glob2lv8/t/op/gmagic.t blead-77362-glob2lv9/t/op/gmagic.t
--- blead-77362-glob2lv8/t/op/gmagic.t 2009-11-19 08:51:40.000000000 -0800
+++ blead-77362-glob2lv9/t/op/gmagic.t 2010-08-26 04:44:07.000000000 -0700
@@ -6,7 +6,7 @@ BEGIN {
@INC = '../lib';
}
-print "1..20\n";
+print "1..22\n";
my $t = 1;
tie my $c => 'Tie::Monitor';
@@ -54,6 +54,13 @@ ok_string($s, '00', 3, 1);
$s = chop($c);
ok_string($s, '0', 1, 1);
+# Assignment should not ignore magic when the last thing assigned
+# was a glob
+$c = *strat;
+$s = $c;
+ok_string $s, *strat, 1, 1;
+
+
# adapted from Tie::Counter by Abigail
package Tie::Monitor;
diff -Nurp blead-77362-glob2lv9.tied/t/op/tie_fetch_count.t blead-77362-glob2lv10.glob-assign-and-magick/t/op/tie_fetch_count.t
--- blead-77362-glob2lv9.tied/t/op/tie_fetch_count.t 2010-08-26 06:18:49.000000000 -0700
+++ blead-77362-glob2lv10.glob-assign-and-magick/t/op/tie_fetch_count.t 2010-08-28 09:42:40.000000000 -0700
@@ -163,7 +163,7 @@ tie my $var3 => 'main', {};
$dummy = %$var3 ; check_count '%{}';
{
no strict 'refs';
- tie my $var4 => 'main', **;
+ tie my $var4 => 'main', \**;
$dummy = *$var4 ; check_count '*{}';
}
|
From @cpansproutOn Sun Aug 29 13:53:25 2010, sprout wrote:
Applied as 5cf4b25 with modifications: tie_fetch_count.t no |
From [Unknown Contact. See original ticket]On Sun Aug 29 13:53:25 2010, sprout wrote:
Applied as 5cf4b25 with modifications: tie_fetch_count.t no |
@cpansprout - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#77498 (status was 'resolved')
Searchable as RT77498$
The text was updated successfully, but these errors were encountered: