From: gfx Date: Sun, 23 Aug 2009 09:13:00 +0000 (+0900) Subject: Add a comment for GETMAGIC in accessors X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=56155a5dd80bbbbd26d09d896b67b6d40b512624;p=gitmo%2FClass-MOP.git Add a comment for GETMAGIC in accessors --- diff --git a/xs/MethodAccessor.xs b/xs/MethodAccessor.xs index 18e4c3d..8e3a99e 100644 --- a/xs/MethodAccessor.xs +++ b/xs/MethodAccessor.xs @@ -57,6 +57,10 @@ mop_accessor_get_self(pTHX_ I32 const ax, I32 const items, CV* const cv) { croak("too few arguments for %s", GvNAME(CvGV(cv))); } + /* NOTE: If self has GETMAGIC, $self->accessor will invoke GETMAGIC + * before calling methods, so SvGETMAGIC(self) is not necessarily needed here. + */ + self = ST(0); if(!(SvROK(self) && SvOBJECT(SvRV(self)))){ croak("cant call %s as a class method", GvNAME(CvGV(cv)));