Skip to content

Commit d174ebf

Browse files
committed
Make sure we did slot allocation before trying to obtain attribute lookup hints.
1 parent 3cb1917 commit d174ebf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/6model/reprs/P6opaque.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,13 @@ static void bind_attribute_str(PARROT_INTERP, PMC *obj, PMC *class_handle, STRIN
586586

587587
/* Gets the hint for the given attribute ID. */
588588
static INTVAL hint_for(PARROT_INTERP, PMC *obj, PMC *class_key, STRING *name) {
589+
INTVAL slot;
589590
P6opaqueREPRData *repr_data = (P6opaqueREPRData *)STABLE(obj)->REPR_data;
590-
INTVAL slot = try_get_slot(interp, repr_data, class_key, name);
591+
if (!repr_data->allocation_size) {
592+
compute_allocation_strategy(interp, obj, repr_data);
593+
PARROT_GC_WRITE_BARRIER(interp, STABLE_PMC(obj));
594+
}
595+
slot = try_get_slot(interp, repr_data, class_key, name);
591596
return slot >= 0 ? slot : NO_HINT;
592597
}
593598

0 commit comments

Comments
 (0)