diff options
author | Tony Cook <tony@develop-help.com> | 2022-11-17 14:30:39 +1100 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2022-11-18 18:12:45 -0500 |
commit | 2e4090b82403991910f1fe64866048b62ccf5402 (patch) | |
tree | 8ca250b0bfb4e386128336ee73db71caba26c032 /scope.c | |
parent | a33534361e54c6342c59edd0c06b6bbb9ac5776c (diff) | |
download | perl-2e4090b82403991910f1fe64866048b62ccf5402.tar.gz |
only fully calculate the stash (effective) name where needed
gcc 12 was complaining that evaluating (somehekptr)->hek_key
was always true in many places where HvNAME() or HvENAME() was
being called in boolean context.
Add new macros to check whether the names should be available and
use those instead.
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -451,7 +451,7 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty) HV * const stash = GvSTASH(gv); bool isa_changed = 0; - if (stash && HvENAME(stash)) { + if (stash && HvHasENAME(stash)) { if (memEQs(GvNAME(gv), GvNAMELEN(gv), "ISA")) isa_changed = TRUE; else if (GvCVu(gv)) @@ -1171,7 +1171,7 @@ Perl_leave_scope(pTHX_ I32 base) HV * hv; a0 = ap[0]; a1 = ap[1]; a2 = ap[2]; hv = GvSTASH(a0.any_gv); - if (hv && HvENAME(hv) && ( + if (hv && HvHasENAME(hv) && ( (a2.any_sv && SvTYPE(a2.any_sv) == SVt_PVCV) || (*a1.any_svp && SvTYPE(*a1.any_svp) == SVt_PVCV) )) @@ -1286,7 +1286,7 @@ Perl_leave_scope(pTHX_ I32 base) had_method = cBOOL(GvCVu(a0.any_gv)); gp_free(a0.any_gv); GvGP_set(a0.any_gv, (GP*)a1.any_ptr); - if ((hv=GvSTASH(a0.any_gv)) && HvENAME_get(hv)) { + if ((hv=GvSTASH(a0.any_gv)) && HvHasENAME(hv)) { if (memEQs(GvNAME(a0.any_gv), GvNAMELEN(a0.any_gv), "ISA")) mro_isa_changed_in(hv); else if (had_method || GvCVu(a0.any_gv)) |