In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/217f6fa330a187be32a68556507e3165b8747f55?hp=637917bb2be52531e0e1877cc368f6f9f48e6bc0>
- Log ----------------------------------------------------------------- commit 217f6fa330a187be32a68556507e3165b8747f55 Author: Father Chrysostomos <[email protected]> Date: Fri Jul 19 08:51:47 2013 -0700 sv.c: Assert that sv_[ivp]v are not passed aggregates The lack of assertions can hide bugs. See 32a609747bffb for instance ----------------------------------------------------------------------- Summary of changes: sv.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sv.c b/sv.c index 3ac0a2b..daa87f0 100644 --- a/sv.c +++ b/sv.c @@ -2273,6 +2273,9 @@ Perl_sv_2iv_flags(pTHX_ SV *const sv, const I32 flags) if (!sv) return 0; + assert (SvTYPE(sv) != SVt_PVAV && SvTYPE(sv) != SVt_PVHV + && SvTYPE(sv) != SVt_PVFM); + if (SvGMAGICAL(sv) && (flags & SV_GMAGIC)) mg_get(sv); @@ -2447,6 +2450,8 @@ Perl_sv_2nv_flags(pTHX_ SV *const sv, const I32 flags) dVAR; if (!sv) return 0.0; + assert (SvTYPE(sv) != SVt_PVAV && SvTYPE(sv) != SVt_PVHV + && SvTYPE(sv) != SVt_PVFM); if (SvGMAGICAL(sv) || SvVALID(sv) || isREGEXP(sv)) { /* 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. @@ -2752,6 +2757,8 @@ Perl_sv_2pv_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags) *lp = 0; return (char *)""; } + assert (SvTYPE(sv) != SVt_PVAV && SvTYPE(sv) != SVt_PVHV + && SvTYPE(sv) != SVt_PVFM); if (SvGMAGICAL(sv) && (flags & SV_GMAGIC)) mg_get(sv); if (SvROK(sv)) { -- Perl5 Master Repository
