-
Notifications
You must be signed in to change notification settings - Fork 560
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
Bleadperl 5cf4b255 breaks VPIT/Variable-Magic-0.44.tar.gz #10761
Comments
From @andkgit bisect: commit 5cf4b25 [perl #77498] Assignment ignores magick when the RHS holds a glob perl -V: Summary of my perl5 (revision 5 version 13 subversion 6) configuration: Characteristics of this binary (from libperl): -- |
From @cpansproutOn Tue Oct 26 14:28:16 2010, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
In perl 5.12.0, *{ ... } ignores magic on its argument if it is already An unintended result is that a plain *a now calls get-magic on *a, The change that broke Variable::Magic fixes another bug: $a = $b was The result was that VM’s test in t/34-glob.t that ‘local *b = *a’ called I tried modifying pp_rv2gv to skip magic on a glob without the FAKE flag Interestingly, those tests are effectively skipped for perls earlier So now what? Should I apply this patch and let Vincent figure out what to do with VM? |
From @cpansproutInline Patchdiff --git a/pp.c b/pp.c
index c99d697..76f353a 100644
--- a/pp.c
+++ b/pp.c
@@ -139,7 +139,7 @@ PP(pp_rv2gv)
{
dVAR; dSP; dTOPss;
- SvGETMAGIC(sv);
+ if (!isGV(sv) || SvFAKE(sv)) SvGETMAGIC(sv);
if (SvROK(sv)) {
wasref:
tryAMAGICunDEREF(to_gv);
diff --git a/t/op/gmagic.t b/t/op/gmagic.t
index 65441a6..bc8a926 100644
--- a/t/op/gmagic.t
+++ b/t/op/gmagic.t
@@ -6,7 +6,7 @@ BEGIN {
@INC = '../lib';
}
-print "1..22\n";
+print "1..24\n";
my $t = 1;
tie my $c => 'Tie::Monitor';
@@ -60,6 +60,19 @@ $c = *strat;
$s = $c;
ok_string $s, *strat, 1, 1;
+# A plain *foo should not call get-magic on *foo.
+# This method of scalar-tying an immutable glob relies on details of the
+# current implementation that are subject to change. This test may need to
+# be rewritten if they do change.
+my $tyre = tie $::{gelp} => 'Tie::Monitor';
+# Compilation of this eval autovivifies the *gelp glob.
+eval '$tyre->init(0); () = \*gelp';
+my($rgot, $wgot) = $tyre->init(0);
+print "not " unless $rgot == 0;
+print "ok ", $t++, " - a plain *foo causes no get-magic\n";
+print "not " unless $wgot == 0;
+print "ok ", $t++, " - a plain *foo causes no set-magic\n";
+
# adapted from Tie::Counter by Abigail
package Tie::Monitor; |
From [Unknown Contact. See original ticket]On Tue Oct 26 14:28:16 2010, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
In perl 5.12.0, *{ ... } ignores magic on its argument if it is already An unintended result is that a plain *a now calls get-magic on *a, The change that broke Variable::Magic fixes another bug: $a = $b was The result was that VM’s test in t/34-glob.t that ‘local *b = *a’ called I tried modifying pp_rv2gv to skip magic on a glob without the FAKE flag Interestingly, those tests are effectively skipped for perls earlier So now what? Should I apply this patch and let Vincent figure out what to do with VM? |
@cpansprout - Status changed from 'new' to 'open' |
From perl@profvince.com
Why do you think that way?
Not exactly. No tests are skipped in this file. The magical behaviour of
get magic should be called either zero times (if what you describe is Once this is sorted out, I'll adapt the test once again if necessary. Vincent. |
From @cpansproutOn Sun Oct 31 13:20:16 2010, perl@profvince.com wrote:
A simply $a does not call get-magic on $a, because it is just retrieving Likewise, I think a simple *a should work the same way. Another way of putting it: *a = *b should only call set-magic on *a, not get-magic as well.
That’s why I said ‘effectively’. :-)
It’s called twice in that assignment (local *b = *a), because there are Because of the assignment, get-magic is called one more time in the
Like making *a not count as a fetch? :-)
|
From [Unknown Contact. See original ticket]On Sun Oct 31 13:20:16 2010, perl@profvince.com wrote:
A simply $a does not call get-magic on $a, because it is just retrieving Likewise, I think a simple *a should work the same way. Another way of putting it: *a = *b should only call set-magic on *a, not get-magic as well.
That’s why I said ‘effectively’. :-)
It’s called twice in that assignment (local *b = *a), because there are Because of the assignment, get-magic is called one more time in the
Like making *a not count as a fetch? :-)
|
From perl@profvince.com
Fair enough.
What I meant was that it was still testing for 'set' magic. Also, V::M
Like that, yes. Whichever you prefer. Vincent. |
From @cpansproutOn Sun Oct 31 15:22:23 2010, perl@profvince.com wrote:
Now done as f64c9ac. |
@cpansprout - Status changed from 'open' to 'resolved' |
From @andk
> On Sun Oct 31 15:22:23 2010, perl@profvince.com wrote:
> Now done as f64c9ac. Would you mind explaining what's left to do to close this ticket? -- |
From @cpansproutOn Sun Nov 14 23:28:18 2010, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
Variable::Magic’s tests need to be adjusted. Whether the VMG_COMPAT_GLOB_GET constant should be removed, renamed or As far as I understand it, it was supposed to indicate that any mention |
Migrated from rt.perl.org#78580 (status was 'resolved')
Searchable as RT78580$
The text was updated successfully, but these errors were encountered: