mirror of
https://github.com/corda/corda.git
synced 2025-01-09 06:23:04 +00:00
check superclasses in fieldForOffset, not just immediate class
This commit is contained in:
parent
8590695f2d
commit
3e38628ad6
@ -2207,9 +2207,18 @@ pipeAvailable(int fd, int* available)
|
|||||||
}
|
}
|
||||||
|
|
||||||
object
|
object
|
||||||
fieldForOffset(Thread* t, object o, unsigned offset)
|
fieldForOffsetInClass(Thread* t, object c, unsigned offset)
|
||||||
{
|
{
|
||||||
object table = classFieldTable(t, objectClass(t, o));
|
object super = classSuper(t, c);
|
||||||
|
if (super) {
|
||||||
|
object field = fieldForOffsetInClass(t, super, offset);
|
||||||
|
if (field) {
|
||||||
|
return field;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
object table = classFieldTable(t, c);
|
||||||
|
if (table) {
|
||||||
for (unsigned i = 0; i < objectArrayLength(t, table); ++i) {
|
for (unsigned i = 0; i < objectArrayLength(t, table); ++i) {
|
||||||
object field = objectArrayBody(t, table, i);
|
object field = objectArrayBody(t, table, i);
|
||||||
if ((fieldFlags(t, field) & ACC_STATIC) == 0
|
if ((fieldFlags(t, field) & ACC_STATIC) == 0
|
||||||
@ -2218,8 +2227,20 @@ fieldForOffset(Thread* t, object o, unsigned offset)
|
|||||||
return field;
|
return field;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
object
|
||||||
|
fieldForOffset(Thread* t, object o, unsigned offset)
|
||||||
|
{
|
||||||
|
object field = fieldForOffsetInClass(t, objectClass(t, o), offset);
|
||||||
|
if (field) {
|
||||||
|
return field;
|
||||||
|
} else {
|
||||||
abort(t);
|
abort(t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace local
|
} // namespace local
|
||||||
|
Loading…
Reference in New Issue
Block a user