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=10583d277d633338b85cb46bf498a3295e5037bd;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)));