This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
amigaos4: use constant string friendly macros
[perl5.git] / pp_pack.c
index 891d2e2..40c3100 100644 (file)
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -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");