Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Fix a silly bug in P6opaque's slot computation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Oct 2, 2010
1 parent 5295760 commit 9a575ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/metamodel/reprs/P6opaque.c
Expand Up @@ -60,7 +60,6 @@ static PMC * accessor_call(PARROT_INTERP, PMC *obj, STRING *name) {
/* This computes the slot mapping for a type; that is, for single inheritance
* classes it works out an allocation in an array for storing the attributes. */
static void compute_slot_mapping(PARROT_INTERP, PMC *WHAT, REPRP6opaque *repr) {
PMC *HOW = STABLE(WHAT)->HOW;
PMC *current_class = WHAT;
INTVAL current_slot = 0;
STRING *attributes_str = Parrot_str_new_constant(interp, "attributes");
Expand All @@ -77,7 +76,8 @@ static void compute_slot_mapping(PARROT_INTERP, PMC *WHAT, REPRP6opaque *repr) {
INTVAL num_parents;

/* Get attributes and iterate over them. */
PMC *attributes = introspection_call(interp, WHAT, HOW, attributes_str);
PMC *HOW = STABLE(current_class)->HOW;
PMC *attributes = introspection_call(interp, current_class, HOW, attributes_str);
PMC *attr_iter = VTABLE_get_iter(interp, attributes);
while (VTABLE_get_bool(interp, attr_iter)) {
/* Get attribute. */
Expand All @@ -99,7 +99,7 @@ static void compute_slot_mapping(PARROT_INTERP, PMC *WHAT, REPRP6opaque *repr) {
}

/* Find the next parent(s). */
parents = introspection_call(interp, WHAT, HOW, parents_str);
parents = introspection_call(interp, current_class, HOW, parents_str);

// Check how many parents we have.
num_parents = VTABLE_elements(interp, parents);
Expand Down

0 comments on commit 9a575ba

Please sign in to comment.