On Fri Dec 23 09:58:54 2011, sprout wrote: > On Thu Jul 26 05:08:19 2007, jpeacock@rowman.com wrote: > > Better to patch > > B::Deparse to make an effort to see whether the original string > > representation > > is still valid (though I have this vague memory that code in toke.c is > > not part > > of the public API, and hence is not available to use here). > > It’s not just B::Deparse, but the version module, too, that is affected: > > $ ./perl -Ilib -le 'print version->new(~v165); > v165 > > And constant folding is not where the problem lies: > > $ ./perl -Ilib -le 'print new version ~$_ for "\xce", v2, "\xcc"' > 1 > v2 > 3 I tried adding a simple set callback that frees the magic, but that, of course, stops $x=v0 from having vstring magic set on $x afterwards. pp_complement does sv_setsv, forces it to a string, modifies it, and then calls set-magic. That should be perfectly acceptable. pp_complement shouldn’t have to know about vstring magic. So I have added a set callback that checks whether the string is still the same. (This doesn’t belong in Deparse, as it applies to core operators, too.) It is in commit 1e6bda93. -- Father Chrysostomos --- via perlbug: queue: perl5 status: open https://rt.perl.org:443/rt3/Ticket/Display.html?id=29070Thread Previous | Thread Next