diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-05-23 12:10:15 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-05-23 12:10:15 +0100 |
commit | 2b2b6d6da41759580414af44e02f63b753aa6869 (patch) | |
tree | 6ae62d7f5a41e6379d04da2f96a96d68f9ac209f /sv.c | |
parent | 9f4173836a23515ff86154e9d21c4c35e075432b (diff) | |
download | perl-2b2b6d6da41759580414af44e02f63b753aa6869.tar.gz |
Correct and update the comments about FBMs in Perl_sv_2[inu]v_flags().
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -2268,10 +2268,12 @@ Perl_sv_2iv_flags(pTHX_ register SV *const sv, const I32 flags) if (!sv) return 0; if (SvGMAGICAL(sv) || (SvTYPE(sv) == SVt_PVGV && SvVALID(sv))) { - /* FBMs use the same flag bit as SVf_IVisUV, so must let them - cache IVs just in case. In practice it seems that they never - actually anywhere accessible by user Perl code, let alone get used - in anything other than a string context. */ + /* FBMs use the space for SvIVX and SvNVX for other purposes, and use + the same flag bit as SVf_IVisUV, so must not let them cache IVs. + In practice they are extremely unlikely to actually get anywhere + accessible by user Perl code - the only way that I'm aware of is when + a constant subroutine which is used as the second argument to index. + */ if (flags & SV_GMAGIC) mg_get(sv); if (SvIOKp(sv)) @@ -2355,8 +2357,8 @@ Perl_sv_2uv_flags(pTHX_ register SV *const sv, const I32 flags) if (!sv) return 0; if (SvGMAGICAL(sv) || (SvTYPE(sv) == SVt_PVGV && SvVALID(sv))) { - /* FBMs use the same flag bit as SVf_IVisUV, so must let them - cache IVs just in case. */ + /* FBMs use the space for SvIVX and SvNVX for other purposes, and use + the same flag bit as SVf_IVisUV, so must not let them cache IVs. */ if (flags & SV_GMAGIC) mg_get(sv); if (SvIOKp(sv)) @@ -2435,8 +2437,8 @@ Perl_sv_2nv_flags(pTHX_ register SV *const sv, const I32 flags) if (!sv) return 0.0; if (SvGMAGICAL(sv) || (SvTYPE(sv) == SVt_PVGV && SvVALID(sv))) { - /* FBMs use the same flag bit as SVf_IVisUV, so must let them - cache IVs just in case. */ + /* FBMs use the space for SvIVX and SvNVX for other purposes, and use + the same flag bit as SVf_IVisUV, so must not let them cache NVs. */ if (flags & SV_GMAGIC) mg_get(sv); if (SvNOKp(sv)) |