diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-07-29 10:41:18 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2016-07-29 12:39:37 -0700 |
commit | b199a398054415071c9c89df8919653221399fb6 (patch) | |
tree | 3bf6b014bbad58fad69cc887e19613ab92075f90 /pp_pack.c | |
parent | ace3ad0f8709a7fde3c8e2a6249bb3f3fb7c7b16 (diff) | |
download | perl-b199a398054415071c9c89df8919653221399fb6.tar.gz |
Avoid emitting pack("p",...) warning erroneously
A value may legitimately be marked SvTEMP even when it is not about
to be freed.
Diffstat (limited to 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3042,7 +3042,8 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) * of pack() (and all copies of the result) are * gone. */ - if ((SvTEMP(fromstr) || (SvPADTMP(fromstr) && + if (((SvTEMP(fromstr) && SvREFCNT(fromstr) == 1) + || (SvPADTMP(fromstr) && !SvREADONLY(fromstr)))) { Perl_ck_warner(aTHX_ packWARN(WARN_PACK), "Attempt to pack pointer to temporary value"); |