Front page | perl.perl5.porters |
Postings from June 2016
Re: [perl #127875] Blead breaks Scope::Upper
Thread Previous
|
Thread Next
From:
perl
Date:
June 5, 2016 18:39
Subject:
Re: [perl #127875] Blead breaks Scope::Upper
Message ID:
5050dfe8-9418-0842-8175-6b6a3f599325@profvince.com
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 <davem@iabyn.com> [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;
+#endif
+
#ifdef gv_fetchsv
gv = gv_fetchsv(sv, GV_ADDMULTI, t);
#else
@@ -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);
#endif
+#ifdef SU_HAS_NEW_CXT
+ CX_CUR()->blk_oldcop = PL_curcop;
+#endif
=======================================================================
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?
Vincent
Thread Previous
|
Thread Next