|U32 flags
ApR |GV* |gv_autoload_pvn |NULLOK HV* stash|NN const char* name \
|STRLEN len|U32 flags
-Ap |void |gv_check |NN const HV* stash
+Ap |void |gv_check |NN HV* stash
Ap |void |gv_efullname |NN SV* sv|NN const GV* gv
Apmb |void |gv_efullname3 |NN SV* sv|NN const GV* gv|NULLOK const char* prefix
Ap |void |gv_efullname4 |NN SV* sv|NN const GV* gv|NULLOK const char* prefix|bool keepmain
}
void
-Perl_gv_check(pTHX_ const HV *stash)
+Perl_gv_check(pTHX_ HV *stash)
{
dVAR;
I32 i;
return;
for (i = 0; i <= (I32) HvMAX(stash); i++) {
const HE *entry;
+ /* SvIsCOW is unused on HVs, so we can use it to mark stashes we
+ are currently searching through recursively. */
+ SvIsCOW_on(stash);
for (entry = HvARRAY(stash)[i]; entry; entry = HeNEXT(entry)) {
GV *gv;
HV *hv;
if (HeKEY(entry)[HeKLEN(entry)-1] == ':' &&
(gv = MUTABLE_GV(HeVAL(entry))) && isGV(gv) && (hv = GvHV(gv)))
{
- if (hv != PL_defstash && hv != stash)
+ if (hv != PL_defstash && hv != stash && !SvIsCOW(hv))
gv_check(hv); /* nested package */
}
else if ( *HeKEY(entry) != '_'
HEKfARG(GvNAME_HEK(gv)));
}
}
+ SvIsCOW_off(stash);
}
}
#define PERL_ARGS_ASSERT_GV_AUTOLOAD_SV \
assert(namesv)
-PERL_CALLCONV void Perl_gv_check(pTHX_ const HV* stash)
+PERL_CALLCONV void Perl_gv_check(pTHX_ HV* stash)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_GV_CHECK \
assert(stash)
$foo++;
EXPECT
Name "main::foo" used only once: possible typo at - line 4.
+########
+
+use warnings 'once'; # necessary to trigger the crash
+BEGIN{*MUSHROOMS::mushrooms::MUSHROOMS:: = *MUSHROOMS::} # circularity
+$foo++;
+EXPECT
+Name "main::foo" used only once: possible typo at - line 4.