Skip to content
Browse files

Wallpapering problem with GET_ATTR for subclassed Sub PMC.

GET_ATTR_foo give incorrect results. So get full attributes structure and return particular field.

git-svn-id: https://svn.parrot.org/parrot/trunk@40679 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent e2d826d commit d9b19079a906b0cfe10decc449c559f3c96f29a9 @bacek bacek committed Aug 20, 2009
Showing with 18 additions and 17 deletions.
  1. +18 −17 src/pmc/sub.pmc
View
35 src/pmc/sub.pmc
@@ -145,10 +145,11 @@ Sets the name of the subroutine.
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 @@ slurpy arguments).
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 @@ slurpy arguments).
}
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);
}

0 comments on commit d9b1907

Please sign in to comment.
Something went wrong with that request. Please try again.