From 1dc74fdba201402174cfbd293adc42f5a0bafc22 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Fri, 5 Jul 2013 22:51:50 -0700 Subject: Revert "[perl #117855] Store CopFILEGV in a pad under ithreads" This reverts commit c82ecf346. It turn out to be faulty, because a location shared betweens threads (the cop) was holding a reference count on a pad entry in a particu- lar thread. So when you free the cop, how do you know where to do SvREFCNT_dec? In reverting c82ecf346, this commit still preserves the bug fix from 1311cfc0a7b, but shifts it around. --- gv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gv.c') diff --git a/gv.c b/gv.c index a7fdd99706..869d237660 100644 --- a/gv.c +++ b/gv.c @@ -2105,9 +2105,12 @@ Perl_gv_check(pTHX_ HV *stash) continue; file = GvFILE(gv); CopLINE_set(PL_curcop, GvLINE(gv)); - /* set file name for warning */ - CopFILE_setn(PL_curcop, file, HEK_LEN(GvFILE_HEK(gv))); - SvREFCNT_dec(CopFILEGV(PL_curcop)); +#ifdef USE_ITHREADS + CopFILE(PL_curcop) = (char *)file; /* set for warning */ +#else + CopFILEGV(PL_curcop) + = gv_fetchfile_flags(file, HEK_LEN(GvFILE_HEK(gv)), 0); +#endif Perl_warner(aTHX_ packWARN(WARN_ONCE), "Name \"%"HEKf"::%"HEKf "\" used only once: possible typo", -- cgit v1.2.1