summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2007-03-07 21:44:52 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-08 15:06:49 +0000
commit803059618a6e90fb614193e8cdf81c79f27d8764 (patch)
treedb5730c32d430d60f92969264750bf6e012b98b2 /gv.c
parent83a611dd5adb33872b776b40314625f3a354690b (diff)
downloadperl-803059618a6e90fb614193e8cdf81c79f27d8764.tar.gz
Re: [PATCH] Tweaks so that miniperl.exe doesnt croak while building perl.exe
Message-ID: <9b18b3110703071144t787e028s8a79fa1986624b54@mail.gmail.com> p4raw-id: //depot/perl@30517
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gv.c b/gv.c
index f0f21459a6..da1d3a68b8 100644
--- a/gv.c
+++ b/gv.c
@@ -1004,7 +1004,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
if (*name == '!')
require_tie_mod(gv, "!", newSVpvs("Errno"), "TIEHASH", 1);
else if (*name == '-' || *name == '+')
- require_tie_mod(gv, name, newSVpvs("re::Tie::Hash::NamedCapture"), "FETCH", 0);
+ require_tie_mod(gv, name, newSVpvs("Tie::Hash::NamedCapture"), "FETCH", 0);
}
}
return gv;
@@ -1198,6 +1198,8 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
/* magicalization must be done before require_tie_mod is called */
if (sv_type == SVt_PVHV)
require_tie_mod(gv, "!", newSVpvs("Errno"), "TIEHASH", 1);
+ /* NOTE: Errno.pm does the tieing of %! itself when it is executed.
+ This is different to the way %+ and %- are handled. */
break;
case '-':
@@ -1205,7 +1207,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
GvMULTI_on(gv); /* no used once warnings here */
{
bool plus = (*name == '+');
- SV *stashname = newSVpvs("re::Tie::Hash::NamedCapture");
+ SV *stashname = newSVpvs("Tie::Hash::NamedCapture");
AV* const av = GvAVn(gv);
HV *const hv = GvHVn(gv);
HV *const hv_tie = newHV();
@@ -1215,7 +1217,9 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
hv_magic(hv, (GV*)tie, PERL_MAGIC_tied);
sv_magic((SV*)av, (plus ? (SV*)av : NULL), PERL_MAGIC_regdata, NULL, 0);
sv_magic(GvSVn(gv), (SV*)gv, PERL_MAGIC_sv, name, len);
-
+
+ /* NOTE: Tie::Hash::NamedCapture does NOT do the tie of %- or %+ itself.
+ This is different to the way %! is handled. */
if (plus)
SvREADONLY_on(GvSVn(gv));
else
@@ -1224,13 +1228,10 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
SvREADONLY_on(hv);
SvREADONLY_on(tie);
SvREADONLY_on(av);
-
- if (sv_type == SVt_PVHV)
- require_tie_mod(gv, name, stashname, "FETCH", 0);
- else
- SvREFCNT_dec(stashname);
-
- break;
+
+ require_tie_mod(gv, name, stashname, "FETCH", 0);
+
+ break;
}
case '*':
case '#':