summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-04-25 14:08:48 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-05-21 16:51:43 -0700
commita3fb8386c0197cbdf57134ce82c6c5e21263e723 (patch)
tree1579b2fa8cb023f91f40ffde156b27b335501ac2 /scope.c
parentfbdd83da9d18c8503ae64943ae75be034fecb787 (diff)
downloadperl-a3fb8386c0197cbdf57134ce82c6c5e21263e723.tar.gz
scope.c: Simplify and clarify comment
This comment seems to imply that this code is just working around a problem in gv.c, which we could simply correct there. I’ve already tried making the quoted code in gv.c handle *^H without a hash, but it doesn’t actually solve the problem. The real problem is that rv2hv could also add a hash to *^H, via GvHVn, and that is simply not set up to deal with autovivifying magic at all, and probably shouldn’t be. Also, quoting a piece of code that occurs elsewhere is just asking for it to drift apart. By this time, the code in gv.c that is quoted in scope.c is actually three times the length now, and looks completely different.
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/scope.c b/scope.c
index ffd0552ac3..a939f64927 100644
--- a/scope.c
+++ b/scope.c
@@ -1038,21 +1038,8 @@ Perl_leave_scope(pTHX_ I32 base)
GvHV(PL_hintgv) = MUTABLE_HV(SSPOPPTR);
}
if (!GvHV(PL_hintgv)) {
- /* Need to add a new one manually, else gv_fetchpv() can
- add one in this code:
-
- if (SvTYPE(gv) == SVt_PVGV) {
- if (add) {
- GvMULTI_on(gv);
- gv_init_sv(gv, sv_type);
- if (*name=='!' && sv_type == SVt_PVHV && len==1)
- require_errno(gv);
- }
- return gv;
- }
-
- and it won't have the magic set. */
-
+ /* Need to add a new one manually, else rv2hv can
+ add one via GvHVn and it won't have the magic set. */
HV *const hv = newHV();
hv_magic(hv, NULL, PERL_MAGIC_hints);
GvHV(PL_hintgv) = hv;