On Tuesday 05 February 2008 16:29:12 Dave Mitchell wrote: > The bug is due to the fact that in the presence of prototypes, after the > real sub is compiled, its body is physically copied across to a new CV, > which messes the CvOUTSIDE field of any child anon or format subs. > The anon subs are fixed up by looking through the parent's pad for any > '&' entries which point to the children that need fixing. There isn't a > similar way to find formats, so they can't be fixed up. > > The two solutions seem to be: > > a) have pointers in parent pads to formats, or > b) rejig newATTRSUB in such a way that it doesn't have to do the > abomination of copying the CV body. > > Don't really have time to look at this further yet. I don't think b) is tractable. If anything's taken a reference to a sub prototype, it points to the first CV. If you stuff a new CV (a properly mangled PL_compcv, for example) in the GV (or wherever), you break at least an AutoLoader test in the core, and some expectations elsewhere. My failed attempt produced failures in: ../ext/Math-BigInt-FastCalc/t/bigintfc.t ../lib/AutoLoader/t/01AutoLoader.t ../lib/Exporter.t ../lib/Math/BigInt/t/sub_mbf.t ../lib/bignum/t/bninfnan.t ../lib/bignum/t/brinfnan.t op/closure.t op/method.t ... along these lines: not ok 41 # Failed at t/op/method.t line 136 # got 'B: In B::e, 2' # expected 'C: In C::e, 1' not ok 42 # Failed at t/op/method.t line 138 # got 'B: In A::ee, 3' # expected 'B: In A::ee, 2' not ok 43 # Failed at t/op/method.t line 139 # got 'B: In A::ee, 3' # expected 'B: In A::ee, 2' -- cThread Previous