fix bootimage field offset calculation for derived classes

There was a subtle bug in that we were not considering alignment
padding for fields defined in superclasses when calculating field
offsets for a derived class when the superclass(es) were visited by
the bootimage generator before the derived class.
This commit is contained in:
Joel Dice 2012-03-04 11:38:12 -07:00
parent 1d77b06540
commit ac63d08450

View File

@ -435,6 +435,10 @@ makeCodeImage(Thread* t, Zone* zone, BootImage* image, uint8_t* code,
memberFields[memberIndex] = *f;
while (targetMemberOffset % f->targetSize) {
++ targetMemberOffset;
}
targetMemberOffset += f->targetSize;
++ memberIndex;