Instead of turning off the flag only when we need to turn it off
(when there is a hek, which is the only time it should be on), just
turn it off unconditionally.
This gets Scope::Upper working once more.
While it is arguably the module’s fault, it’s still a good idea to
make cvgv_set robust. CvNAMED should never be on after calling it,
regardless of the previous state of the CV.
}
else if ((hek = CvNAME_HEK(cv))) {
unshare_hek(hek);
- CvNAMED_off(cv);
CvLEXICAL_off(cv);
}
+ CvNAMED_off(cv);
SvANY(cv)->xcv_gv_u.xcv_gv = gv;
assert(!CvCVGV_RC(cv));