On 11/03/2011 12:08 PM, David Golden wrote: > On Mon, Oct 31, 2011 at 11:17 AM, Brian Fraser<fraserbn@gmail.com> wrote: >> There's a couple other uses of sv_derived_from that check for version >> objects, like line 618 of universal.c. Should those get the added guards >> too? > > Yes. > > Or maybe we need a "sv_obj_isa" function/macro to encapsulate the concept. Sorry I took so long to respond to this. Yes, I think sv_obj_isa would be the right way to go with this. I actually added this to the CPAN version.pm distro: #define ISA_VERSION_OBJ(v,c) (SvROK(v) && sv_derived_from(v,c)) though there is nothing about that define that is specific to version objects. > Nicholas -- I believe the patch is correct enough, though a segfault > is still possible if someone creates a bogus object and blesses it to > 'version' or a subclass thereof. There is already a vverify() routine, which should protect the vast majority of the possible problems with bogus objects. JohnThread Previous