The cache will just be invalidate on the next fetch. This commit avoids
extra work in those cases that are detectable. We still have to invali-
date caches in mg_get, because caches can be created while magic is
being called and SvMAGICAL is off.
const STRLEN ulen)
{
PERL_ARGS_ASSERT_UTF8_MG_LEN_CACHE_UPDATE;
- if (SvREADONLY(sv) || !SvPOK(sv))
+ if (SvREADONLY(sv) || SvGMAGICAL(sv) || !SvPOK(sv))
return;
if (!*mgp && (SvTYPE(sv) < SVt_PVMG ||