develooper Front page | perl.perl5.porters | Postings from June 2016

Re: [perl #127875] Blead breaks Scope::Upper

Thread Previous | Thread Next
June 5, 2016 18:39
Re: [perl #127875] Blead breaks Scope::Upper
Message ID:

Le 29/05/2016 à 23:53, Dave Mitchell a écrit :
> On Mon, Apr 18, 2016 at 09:44:35AM -0300, Vincent Pit (VPIT) wrote:
>> Le 18/04/2016 09:29, Ricardo Signes a écrit :
>>> * Dave Mitchell <> [2016-04-18T06:10:56]
>>>> I've spent the last week doing more work on Scope::Upper.
>>> Thanks for looking into this, Dave.  I agree with your remarks on the question
>>> of requiredness of this sort of work, but I'm also glad that it may continue to
>>> work.  Although I don't plan to block on Scope::Upper, it is a useful tool.
>>> (Leon T. was also talking about writing a subset of its functionality that was
>>> easier to keep working, which is what more of Scope::Upper's downstream
>>> dependents use.)
>> The dependants seem to use all the features provided by Scope::Upper, so I
>> don't really understand what subset would be "easier to keep working".
>> Unless all dependents are not treated equal, of course.
> The attached series of 8 patches makes Scope::Upper pass all tests on
> 5.24.0, as well as all major perls back to 5.10.1. (I didn't test
> on 5.6.x and 5.8.x as these require Test::More to be installed).

Thanks a lot for your hard work, Dave. I hope that the code base was not 
too unpleasant to work on.

I just have a small question regarding commit ded730eb9 ("get 
su_init/su_pop working under 5.23.8"). In su_localize, you added this 
snippet :


+/* new perl context implementation frees savestack *before* restoring
+ * PL_curcop. Temporarily restore it prematurely to make gv_fetch*
+ * looks up unqualified var names in the caller's package */
+#ifdef SU_HAS_NEW_CXT
+  COP *old_cop = PL_curcop;
+  PL_curcop = CX_CUR()->blk_oldcop;
   #ifdef gv_fetchsv
     gv = gv_fetchsv(sv, GV_ADDMULTI, t);
@@ -896,13 +926,16 @@ static void su_localize(pTHX_ void *ud_) {
     const char *name = SvPV_const(sv, len);
     gv = gv_fetchpvn_flags(name, len, GV_ADDMULTI, t);
+#ifdef SU_HAS_NEW_CXT
+  CX_CUR()->blk_oldcop = PL_curcop;


but as far as I can tell this old_cop variable is never used. Since the 
tests pass with this change, does it mean that it can be removed?


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About