[svn:parrot] r40679 - trunk/src/pmc
bacek at svn.parrot.org
bacek at svn.parrot.org
Thu Aug 20 21:36:38 UTC 2009
Author: bacek
Date: Thu Aug 20 21:36:37 2009
New Revision: 40679
URL: https://trac.parrot.org/parrot/changeset/40679
Log:
Wallpapering problem with GET_ATTR for subclassed Sub PMC.
GET_ATTR_foo give incorrect results. So get full attributes structure and return particular field.
Modified:
trunk/src/pmc/sub.pmc
Modified: trunk/src/pmc/sub.pmc
==============================================================================
--- trunk/src/pmc/sub.pmc Thu Aug 20 21:24:00 2009 (r40678)
+++ trunk/src/pmc/sub.pmc Thu Aug 20 21:36:37 2009 (r40679)
@@ -145,10 +145,11 @@
VTABLE STRING *get_string() {
STRING *name;
- GET_ATTR_name(INTERP, SELF, name);
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
- if (name)
- return Parrot_str_copy(INTERP, name);
+ if (sub->name)
+ return Parrot_str_copy(INTERP, sub->name);
return NULL;
}
@@ -951,30 +952,30 @@
METHOD get_lexinfo() {
PMC *lexinfo;
- GET_ATTR_lex_info(INTERP, SELF, lexinfo);
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
- if (!lexinfo)
- lexinfo = PMCNULL;
+ lexinfo = sub->lex_info ? sub->lex_info: PMCNULL;
RETURN(PMC *lexinfo);
}
METHOD get_subid() {
STRING *subid;
- GET_ATTR_subid(INTERP, SELF, subid);
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
- if (!subid)
- subid = CONST_STRING(interp, "");
+ subid = sub->subid ? sub->subid : CONST_STRING(interp, "");
RETURN(STRING *subid);
}
METHOD get_outer() {
- PMC *outersub;
- GET_ATTR_outer_sub(INTERP, SELF, outersub);
+ PMC *outersub;
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
- if (!outersub)
- outersub = PMCNULL;
+ outersub = sub->outer_sub ? sub->outer_sub : PMCNULL;
RETURN(PMC *outersub);
}
@@ -1005,11 +1006,11 @@
}
METHOD get_multisig() {
- PMC *multisig;
- GET_ATTR_multi_signature(INTERP, SELF, multisig);
+ PMC *multisig;
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
- if (!multisig)
- multisig = PMCNULL;
+ multisig = sub->multi_signature ? sub->multi_signature : PMCNULL;
RETURN(PMC *multisig);
}
More information about the parrot-commits
mailing list